C# 如何使用Azure ACS保护新的MVC5应用程序

C# 如何使用Azure ACS保护新的MVC5应用程序,c#,asp.net,azure,C#,Asp.net,Azure,我正在尝试使用Azure ACS配置一个新的MVC5应用程序,但我没有太多机会将我的项目连接到联合端点 我首先创建了一个ACS(名称空间、idp和RP)。我的RP的URI是:http://localhost/ACSDemo.联合元数据终结点url为 https://hmhacsdemo.accesscontrol.windows.net/FederationMetadata/2007-06/FederationMetadata.xml 在VS(2013)中,我创建了一个新的web应用程序,选择M

我正在尝试使用Azure ACS配置一个新的MVC5应用程序,但我没有太多机会将我的项目连接到联合端点

我首先创建了一个ACS(名称空间、idp和RP)。我的RP的URI是:
http://localhost/ACSDemo.
联合元数据终结点url为
https://hmhacsdemo.accesscontrol.windows.net/FederationMetadata/2007-06/FederationMetadata.xml

在VS(2013)中,我创建了一个新的web应用程序,选择MVC并将身份验证选项更改为“组织帐户”,将类型指定为“本地”,并提供我的metdata url和应用程序URI,然后单击“确定”

单击“确定”以创建项目。VS旋转一点,然后我看到了我的解决方案。在web.config中,我找到以下appsettings:

 <add key="ida:AdfsMetadataEndpoint" value="https://hmhacsdemo.accesscontrol.windows.net/FederationMetadata/2007-06/FederationMetadata.xml" />
 <add key="ida:Audience" value="http://localhost/ACSDemo" />
但是,当我尝试浏览网站(在VS中按f5)时,会出现以下错误:

HTTP Error 401.0 - Unauthorized
You do not have permission to view this directory or page.

Most likely causes:
The authenticated user does not have access to a resource needed to process the request.

Things you can try:
Check the failed request tracing logs for additional information about this error. For more information, click here.

Detailed Error Information:
Module     ManagedPipelineHandler
Notification       ExecuteRequestHandler
Handler    System.Web.Mvc.MvcHandler
Error Code     0x00000000
它的行为就像它不知道应该如何验证其资源一样


我在这里遗漏了什么?

显然,除非您以管理员身份运行VS,否则向导将在未说明任何问题的情况下死亡

我重复了上述步骤,这次以管理员身份启动VS2013,授权向导将必要的配置添加到我的项目中

HTTP Error 401.0 - Unauthorized
You do not have permission to view this directory or page.

Most likely causes:
The authenticated user does not have access to a resource needed to process the request.

Things you can try:
Check the failed request tracing logs for additional information about this error. For more information, click here.

Detailed Error Information:
Module     ManagedPipelineHandler
Notification       ExecuteRequestHandler
Handler    System.Web.Mvc.MvcHandler
Error Code     0x00000000