简体   繁体   English

.NET 4.5 声明身份模型

[英].NET 4.5 Claims Identity Model

We have two ASP .NET web applications living on different servers.我们有两个 ASP .NET Web 应用程序位于不同的服务器上。 All authentication in our organization is done via Windows Authentication against Active Directory - so no username and password authentication in the web apps themselves.我们组织中的所有身份验证都是通过针对 Active Directory 的 Windows 身份验证完成的 - 因此在 Web 应用程序本身中没有用户名和密码身份验证。

We'd like to use claims based authorization and have these two web applications share information about what claims a given user has.我们希望使用基于声明的授权,并让这两个 Web 应用程序共享有关给定用户拥有哪些声明的信息。

I'm trying to figure out how to go about this.我正在努力弄清楚如何解决这个问题。

We have ADFS 2.0 and I know I can set up Federated Authentication using this...but where should my AD users' claims be stored and how are they hydrated and thus shared.我们有 ADFS 2.0,我知道我可以使用它来设置联合身份验证……但是我的 AD 用户的声明应该存储在哪里,以及它们如何水合和共享。 Do the claims themselves end up in cookies after authentication?身份验证后,声明本身是否以 cookie 结尾?

Specifically, the scenario should be this:具体来说,场景应该是这样的:

  • User navigates to web app 1用户导航到 Web 应用程序 1
  • Business decisions are made based on the ClaimsPrincipal's AuthorizationDecision ClaimsTypes业务决策基于 ClaimsPrincipal 的 AuthorizationDecision ClaimsTypes
  • Web app 1 redirects to web app 2 (or they navigate there directly later) Web 应用程序 1 重定向到 Web 应用程序 2(或者稍后直接导航到那里)
  • Business decisions are made based on the same AuthorizationDecision ClaimsTypes' values业务决策是基于相同的 AuthorizationDecision ClaimsTypes 值做出的
  • Why?为什么? Because web app 1 and web app 2 both pull some common data from a third party data source - and they both need to know if the user is authorized to view certain entity types in that third party data.因为 Web 应用程序 1 和 Web 应用程序 2 都从第三方数据源中提取一些通用数据 - 他们都需要知道用户是否有权查看该第三方数据中的某些实体类型。

Claims are filled from a store.索赔是从商店填写的。 Default store for ADFS is the AD. ADFS 的默认存储是 AD。 ADFS can get the content of your AuthorizationDecision from an AD attribute and/or from a Custom Attribute store: Microsoft.IdentityServer.ClaimsPolicy.Engine.AttributeStore.IAttributeStore. ADFS 可以从 AD 属性和/或自定义属性存储中获取 AuthorizationDecision 的内容:Microsoft.IdentityServer.ClaimsPolicy.Engine.AttributeStore.IAttributeStore。 This would provide a central location for configuration and administration.这将为配置和管理提供一个中心位置。

The Apps could also query themselves and add to the claims.应用程序还可以查询自己并添加到声明中。 Different versions of the claims framework have slightly different interfaces.不同版本的声明框架的接口略有不同。 And yes, the apps store their claims in a cookie (each app has its own cookies).是的,应用程序将他们的声明存储在 cookie 中(每个应用程序都有自己的 cookie)。 Unless you want smaller cookies, then the cookie only contains a reference.除非你想要更小的 cookie,否则 cookie 只包含一个引用。 In this apps 'claims enrichment' scenario, each app needs the logic.在这个应用程序“声明丰富”的场景中,每个应用程序都需要逻辑。

Both scenarios have advantages and disadvantages.这两种情况都有优点和缺点。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM