asp.net-mvc-4 - MS 身份和访问工具 MVC 4

标签 asp.net-mvc-4 visual-studio-2012 wif claims-based-identity

此 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/

相关文章:

visual-studio-2010 - VS2010/MSBuild 4.0 构建外部项目

具有 Azure Active Directory 身份验证的 Azure WCF 服务

c# - 与 ADFS 2.0 联合时如何正确设置超时

hosting - 无法加载类型 'System.Reflection.IntrospectionExtensions' ,ASP.NET MVC 4 (RC),可能是 Facebook C# SDK 的错误?

asp.net-mvc - MVC4 枚举和单选按钮列表

visual-studio-2012 - 每次在 applicationhost.config 中重新启动时,如何阻止 Visual Studio/IIS express 创建新的 <site>

sql-server - SQL72043和其他SSDT错误: how can I find the incorrect code?

validation - Asp.NET MVC - 在 Controller 之外验证模型

c# - MVC4 + jQuery 淡出通知 div

visual-studio-2010 - WIF、STS 和成员资格表