MS身份和访问工具MVC 4 [英] MS Identity and Access Tool MVC 4

查看:287
本文介绍了MS身份和访问工具MVC 4的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这VS 2012的扩展是为了让我的本地开发STS添加到我的MVC应用程序的http://visualstudiogallery.msdn.microsoft.com/e21bf653-dfe1-4d81-b3d3-795cb104066e

This VS 2012 extension is meant to allow me to add a local Development STS to my MVC application http://visualstudiogallery.msdn.microsoft.com/e21bf653-dfe1-4d81-b3d3-795cb104066e

我按照非常简单的指令如右键单击菜单中的项目名称并选择身份和访问。选择您的身份提供者,并确定将设置应用到你的web.config。

I follow the very simple instructions e.g. Right Click the project name and select Identity and Access in the menu. Select your Identity Provider and the OK to apply the settings to your web.config.

我跑我的MVC 4应用并​​立即重定向到l​​ogin.aspx的

I run my MVC 4 application and it redirects immediately to login.aspx

我猜有 特殊作为MVC 4.说明

I'm guessing there are special instructions for MVC 4.

它们是什么?

在哪里可以找到他们呢?

Where do I find them?

修改

要清楚,我创建在Visual Studio 2012年。然后,ASP.MVC 4互联网应用我使用的是身份和放大器;访问工具添加本地开发STS来测试我的应用程序。

To be clear I have created a ASP.MVC 4 Internet application in visual studio 2012. Then I am using the Identity & Access Tool to add a local development STS to Test my application.

我正在运行的本地IIS防爆preSS网站

I am running the site on a local IIS Express

当我调试,我重定向到应用程序

When I debug the application I am redirected to

本地主机:11378 / login.aspx的RETURNURL =%2F

localhost:11378/login.aspx?ReturnUrl=%2f

这会发生,即使我删除窗体身份验证中已经给意见建议。

This occurs even if I remove forms authentication as suggested in advice already given.

推荐答案

在我来说,我添加了这个

In my case I added this

<system.web>
...
<httpModules>
...
    <remove name="FormsAuthentication" />
</httpModules>
</system.web>

<system.webServer>
...
   <modules>
   ...
      <remove name="FormsAuthentication" />
   </modules>
</system.webServer>

修改

你可能会得到下一个问题是这样的。

The next problem you might get is this

类型的索赔
   http://schemas.xmlsoap.org/ws/2005/05/身份/索赔/的NameIdentifier
  要么
  的http://schemas.microsoft.com/accesscontrolservice/2010/07/claims/identityprovider'
  是不是所提供的ClaimsIdentity present。要启用防伪
  基于声明的身份验证令牌支持,请确认
  配置声明提供的同时提供对这些索赔
  ClaimsIdentity情况下,它会生成。如果配置要求
  提供商,而不是使用不同的权利要求的类型作为唯一标识符,
  它可以通过设置静态属性进行配置
  AntiForgeryConfig.UniqueClaimTypeIdentifier。

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.

在Identity这些索赔2添加到STS发展和Access工具

add these 2 claims to the Development STS in the Identity and Access Tool

http://schemas.xmlsoap.org/ws/2005/ 05 /身份证/索赔/的NameIdentifier 结果
http://schemas.microsoft.com/accesscontrolservice/2010/07/claims/identityprovider

这行添加到您的Global.asax

and add this line to your Global.asax

AntiForgeryConfig.UniqueClaimTypeIdentifier = ClaimTypes.NameIdentifier;

这篇文章帮我

这篇关于MS身份和访问工具MVC 4的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆