System.IdentityModel.Policy.IAuthorizationPolicy 过时了吗?
Is System.IdentityModel.Policy.IAuthorizationPolicy obsolete?
根据这篇 msdn 文章,接口 IAuthorizationPolicy 是使用 wcf 时注入自定义授权逻辑/自定义声明的方法。
https://msdn.microsoft.com/en-us/library/ms729851(v=vs.110).aspx
不过这个界面里用的类好像是"almost obsolete"
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 中引入的 "new" 身份管道弃用。
ClaimsAuthenticationManager 现在是在主体访问服务代码之前向主体添加声明的扩展点。 ClaimsAuthorizationManager 可用于隔离授权策略(例如,结合 ClaimsPrincipalPermission class)。
根据这篇 msdn 文章,接口 IAuthorizationPolicy 是使用 wcf 时注入自定义授权逻辑/自定义声明的方法。
https://msdn.microsoft.com/en-us/library/ms729851(v=vs.110).aspx
不过这个界面里用的类好像是"almost obsolete" 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 中引入的 "new" 身份管道弃用。
ClaimsAuthenticationManager 现在是在主体访问服务代码之前向主体添加声明的扩展点。 ClaimsAuthorizationManager 可用于隔离授权策略(例如,结合 ClaimsPrincipalPermission class)。