此 VS 2012 扩展旨在允许我将本地开发 STS 添加到我的 MVC 应用程序 http://visualstudiogallery.msdn.microsoft.com/e21bf653-dfe1-4d81-b3d3-795cb104066e
我遵循非常简单的说明,例如右键单击项目名称,然后在菜单中选择 Identity and Access。选择您的身份提供者和确定将设置应用到您的 web.config。
我运行我的 MVC 4 应用程序,它立即重定向到 login.aspx
我猜有 特价 MVC 4 的说明。
这些是什么?
我在哪里可以找到它们?
编辑
明确地说,我在 Visual Studio 2012 中创建了一个 ASP.MVC 4 Internet 应用程序。然后我使用身份和访问工具添加本地开发 STS 来测试我的应用程序。
我在本地 IIS Express 上运行该站点
当我调试应用程序时,我被重定向到
localhost:11378/login.aspx?ReturnUrl=%2f
即使我按照已经给出的建议中的建议删除了表单例份验证,也会发生这种情况。
最佳答案
就我而言,我添加了这个
<system.web>
...
<httpModules>
...
<remove name="FormsAuthentication" />
</httpModules>
</system.web>
和这个
<system.webServer>
...
<modules>
...
<remove name="FormsAuthentication" />
</modules>
</system.webServer>
编辑
您可能会遇到的下一个问题是
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.
将这 2 个声明添加到身份和访问工具中的开发 STS
http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier
http://schemas.microsoft.com/accesscontrolservice/2010/07/claims/identityprovider
并将这一行添加到您的 Global.asax
AntiForgeryConfig.UniqueClaimTypeIdentifier = ClaimTypes.NameIdentifier;
This article helped me
关于asp.net-mvc-4 - MS 身份和访问工具 MVC 4,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12832239/