2014-12-12 3 views
1

응용 프로그램을 개발하는 동안 Azure Active Directory를 비활성화하거나 우회하는 방법이 있습니까? 나는 다음을 시도했지만 여전히 인증을 위해 AAD로 리다이렉트한다.로컬 호스트를 개발하는 동안 Azure Active Directory를 사용하지 않도록 설정하십시오.

protected void Application_Start() 
    { 
     AreaRegistration.RegisterAllAreas(); 
     //IdentityConfig.ConfigureIdentity(); commented out for dev. 12/12/2014 
     FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); 
     RouteConfig.RegisterRoutes(RouteTable.Routes); 
     BundleConfig.RegisterBundles(BundleTable.Bundles); 
    } 

    //private void WSFederationAuthenticationModule_RedirectingToIdentityProvider(object sender, RedirectingToIdentityProviderEventArgs e) 
    //{ 
    // if (!String.IsNullOrEmpty(IdentityConfig.Realm)) 
    // { 
    //  e.SignInRequestMessage.Realm = IdentityConfig.Realm; 
    // } 
    //} 

IdentityConfig.cs의 메소드를 주석 처리했지만 여전히 AAD로 리디렉션됩니다.

조언이 많이 있습니다.

내 Web.config의이다 :

<appSettings> 
    <add key="webpages:Version" value="3.0.0.0" /> 
    <add key="webpages:Enabled" value="false" /> 
    <add key="ClientValidationEnabled" value="true" /> 
    <add key="UnobtrusiveJavaScriptEnabled" value="true" /> 
    <add key="ida:FederationMetadataLocation" value="https://login.windows.net/accountname.onmicrosoft.com/FederationMetadata/2007-06/FederationMetadata.xml" /> 
    <add key="ida:Realm" value="https://accountname.onmicrosoft.com/application.WebUI" /> 
    <add key="ida:AudienceUri" value="https://accountname.onmicrosoft.com/application.WebUI" /> 
    <add key="StorageConnectionString" value="DefaultEndpointsProtocol=https;AccountName=accountname;AccountKey=+mykey==" /> 
</appSettings> 


<system.webServer> 
<modules> 
    <add name="WSFederationAuthenticationModule" type="System.IdentityModel.Services.WSFederationAuthenticationModule, System.IdentityModel.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" preCondition="managedHandler" /> 
    <add name="SessionAuthenticationModule" type="System.IdentityModel.Services.SessionAuthenticationModule, System.IdentityModel.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" preCondition="managedHandler" /> 
    <remove name="ApplicationInsightsWebTracking" /> 
    <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Extensibility.Web.RequestTracking.WebRequestTrackingModule, Microsoft.ApplicationInsights.Extensibility.Web" preCondition="managedHandler" /> 
</modules> 
<validation validateIntegratedModeConfiguration="false" /> 
</system.webServer> 
<system.identityModel.services> 
<federationConfiguration> 
    <cookieHandler requireSsl="true" /> 
    <wsFederation passiveRedirectEnabled="true" issuer="https://login.windows.net/onalabama.onmicrosoft.com/wsfed" realm="https://onalabama.onmicrosoft.com/Procurement.WebUI" requireHttps="true" /> 
</federationConfiguration> 
</system.identityModel.services> 
+0

web.config에서 ID 구성을 확인 했습니까? –

+0

web.config 코드를 추가했습니다. – JoshYates1980

답변

1

이 솔루션은 매우 일반적 아니라, 당신이 푸른 웹 사이트에 배포하는 경우 당신이 원하는 원하는 단지 수 있습니다. 사용자가 사이트에 접속할 수있게 허용하기 전에 Azure 웹 사이트에 AAD 인증을 요구하도록 요청할 수 있습니다.

기본적으로 코드에서 AAD없이 로컬로 개발하고 해당 방식으로 배포 할 수도 있습니다. Azure 포털의 CONFIG 탭에서 구성한 후에 Azure 웹 사이트 (코드 필요 없음)에 대한 인증이 대신 구성됩니다.

는 여기에 좋은 작성자입니다 : http://azure.microsoft.com/blog/2014/11/13/azure-websites-authentication-authorization/

이 일부 전류 제한 (기사 참조),하지만 난 이미 몇 가지 상황에서이 편리 발견했습니다.

관련 문제