.NET在三个名称空间中的声明 [英] .NET Claim in three namespaces

查看:219
本文介绍了.NET在三个名称空间中的声明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现在这很奇怪。在完成对.NET中基于声明的解决方案的研究之后,发现不同的作者在实际谈论同一问题时会引用.NET名称空间中的不同类。声明类(更不用说其他的Identity,Principal,Manager,Helper类)在3个不同的命名空间中定义。

Now this is odd. After completing some research on claims based solutions in .NET, found that different authors refer to different classes in .NET namespace when actually speaking on the same matter. Claim class (not to mention other Identity, Principal, Manager, Helper classes around) is defined in 3 different namespaces.

很明显,WIF是.NET 3.5和4.0的单独附加组件,它已被重写并成为4.5的核心部分。但是,这对于确定用于新项目的类的明确指示确实有帮助(这样可以更轻松地移植到4.5之后)。

It is clear that WIF is separate add-on for .NET 3.5 and 4.0 and that it is rewritten and made part of core in 4.5. However it could really help to have clear directions on what class to use for new projects (so that port to 4.5 after could be easier). Does anybody else have more info on the subject?

第一个链接: http://msdn.microsoft.com/en-us/library/ms572956(v = vs.110)(System.IdentityModel.Claims命名空间)

1st link: http://msdn.microsoft.com/en-us/library/ms572956(v=vs.110) (System.IdentityModel.Claims namespace)

第二个: http://msdn.microsoft.com/en-us/library/microsoft.identitymodel.claims.claim.aspx (Microsoft.IdentityModel.Claims)

2nd: http://msdn.microsoft.com/en-us/library/microsoft.identitymodel.claims.claim.aspx (Microsoft.IdentityModel.Claims)

第三名:(System.Security.Claims.Claim)

3rd: (System.Security.Claims.Claim)

推荐答案

对于仍在寻找最终答案的任何人对此,MSDN在 System.IdentityModel.Claims命名空间页面...

For anyone still looking for a definitive answer to this, MSDN has the following information on it's System.IdentityModel.Claims Namespace page...


System.IdentityModel.Claims命名空间包含由
实现的类视窗Communication Foundation(WCF)基于声明的
身份授权模型。此模型包括Claim类和
ClaimSet类。

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.

从.NET Framework 4.5开始以及Windows Identity Foundation(WIF)与.NET的
集成。
框架,WCF基于声明的身份模型已被
WIF取代。 WIF提供了一个基于声明的身份对象模型,可以使用
跨多个
Microsoft产品堆栈(包括CLR,WCF和ASP.NET)提供身份验证和授权。代表声明,声明类型和身份的WIF
类以及基于声明的
主体包含在
System.Security.Claims 名称空间中。 从.NET 4.5开始,应使用这些
类,而不是
System.IdentityModel.Claims命名空间中的类。

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.

这篇关于.NET在三个名称空间中的声明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆