0
我正在嘗試使ADFS與ASP.NET 4.5.2和多個域一起工作。只要ADFS服務器將聲明從「upn」轉換爲「名稱」,一切正常。然而,這對於多個AD森林來說是不可能的,所以我必須在Web服務器上執行轉換。使用這個Web.Config條目應該強制這個轉換。ADFS與ASP.NET 4.5和WIF覆蓋NameClaimType
<securityTokenHandlers>
<add type="System.IdentityModel.Tokens.Saml2SecurityTokenHandler, System.IdentityModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<samlSecurityTokenRequirement>
<nameClaimType value="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/upn" />
</samlSecurityTokenRequirement>
</add>
</securityTokenHandlers>
當我調試我發現Thread.CurrentPrincipal.Identity.NameClaimType仍設置爲默認http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name
這將是有用的,如果我能確定在C#中使用什麼樣的積極SecurityTokenHandler。
ADFS的文檔不一致。我在這裏錯過了什麼?
我會捕獲事件並進入更多細節。請參閱https://msdn.microsoft.com/en-us/library/microsoft.identitymodel.web.wsfederationauthenticationmodule_events.aspx – Dhanuka777
您可以擁有一個本地索賠身份驗證管理器,該索引身份驗證管理器在根據您的需求重新解釋令牌解析時觸發並在那裏重寫索賠一旦。 –
該文檔引用完全不同的.NET 3.5。 – user306031