Question
Thursday, November 7, 2013 4:59 AM
Hi,
We are trying to integrate ADFS to a MVC4 application in which CSRF is implemented using Html.AntiForgeryToken().
We are getting the error
A claim of type 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier' or 'http://schemas.microsoft.com/accesscontrolservice/2010/07/claims/identityprovider' was not present on the provided ClaimsIdentity. To enable anti-forgery token support with claims-based authentication, please verify that the configured claims provider is providing both of these claims on the ClaimsIdentity instances it generates. If the configured claims provider instead uses a different claim type as a unique identifier, it can be configured by setting the static property AntiForgeryConfig.UniqueClaimTypeIdentifier
We are trying to add AntiForgeryConfig.UniqueClaimTypeIdentifier in global.asax in application_start event.
But we are not able to find Antiforgeryconfig class in either System.web.webpages / system.web.mvc/system.web.helpers.
Is there any way to fix this issue?
All replies (2)
Thursday, November 7, 2013 5:26 AM ?Answered
Are you sure you are referencing the latest assemblies? A couple of troubleshooting steps:
1. Try updating your references using NuGet and update to the latest Visual Studio Web Tools update.
2. Create a new MVC 4 project from scratch, then copy your existing code into the new project. You should have the updated helpers then.
Thursday, November 7, 2013 8:54 AM ?Answered
This is your issue:
http://brockallen.com/2012/07/08/mvc-4-antiforgerytoken-and-claims/
注册有任何问题请添加 微信:MVIP619 拉你进入群
打开微信扫一扫
添加客服
进入交流群
发表评论