ICode9

精准搜索请尝试: 精确搜索
首页 > 编程语言> 文章详细

C#-System.IdentityModel.Policy.IAuthorizationPolicy过时了吗?

2019-10-28 17:18:06  阅读:243  来源: 互联网

标签:claims wif claims-based-identity wcf c


根据这篇msdn文章,接口IAuthorizationPolicy是使用wcf时注入自定义授权逻辑/自定义声明的方式.

https://msdn.microsoft.com/en-us/library/ms729851(v=vs.110).aspx

但是,根据该接口,似乎某些已使用的类“几乎已过时”
http://msdn.microsoft.com/en-us/library/system.identitymodel.claims%28v=vs.110%29.aspx

The System.IdentityModel.Claims namespace contains classes that
implement the Windows Communication Foundation (WCF) claims-based
identity authorization model. This model includes the Claim class and
the ClaimSet class. Beginning with .NET Framework 4.5 and the
integration of Windows Identity Foundation (WIF) into the .NET
Framework, the WCF claims-based identity model has been superseded by
WIF. WIF provides a claims-based identity object model that can be
used to provide authentication and authorization across several
Microsoft product stacks, including the CLR, WCF, and ASP.NET. The WIF
classes that represent claims, claim types, and identities and
principals that are based on claims are contained in the
System.Security.Claims namespace. Beginning with .NET 4.5, these
classes should be used instead of those in the
System.IdentityModel.Claims namespace.

查看WIF类,似乎似乎无法替代IAuthorizationPolicy,但是可以从scatch(claimsAuthenticationManager / claimsAuthorizationManager)编写自定义身份验证和授权逻辑.建议的方法是什么?

谢谢您的意见

解决方法:

是的,它们已被.NET 4.5中引入的“新”标识管道弃用.

现在,ClaimsAuthenticationManager是可扩展性点,可在到达服务代码之前向主体添加声明. ClaimsAuthorizationManager可用于隔离授权策略(例如,与ClaimsPrincipalPermission类结合使用).

无耻的插头:
http://www.pluralsight.com/courses/iac-wcf

标签:claims,wif,claims-based-identity,wcf,c
来源: https://codeday.me/bug/20191028/1953930.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有