2017-10-03 10 views
0

Application registration portal」にアプリを作成すると、最初のリダイレクトURLだけが動作します。「アプリケーション登録ポータル」アプリに複数のリダイレクトURLを使用する

たとえば、最初にhttps://google.com/を追加すると、このURLが機能します。しかし、もし私がhttps://localhost/を追加してもそれはありません。 https://localhost/を最初に追加し、https://google.com/秒を追加すると、localhost URLだけが動作します。

「アプリケーション登録ポータル」で2つのアプリケーションを個別に作成するだけです。 1つは開発環境用、もう1つは製造用です。

私にとっては、サーバーサイドのキャッシュ問題のように感じます。

答えて

-1

解決済み!私はgithubで見つけた解決策を試してみることを忘れていました。私の問題を解決しました。

https://github.com/IdentityServer/IdentityServer3/issues/1458


UPDATE

私Startup.Auth.csでConfigureAuth方法は、現在、次のコードが含まれます。

app.SetDefaultSignInAsAuthenticationType(CookieAuthenticationDefaults.AuthenticationType); 

app.UseCookieAuthentication(new CookieAuthenticationOptions()); 

app.UseOpenIdConnectAuthentication(
    new OpenIdConnectAuthenticationOptions 
    { 
     ClientId = clientId, 
     Authority = Authority, 

     Notifications = new OpenIdConnectAuthenticationNotifications() 
     { 
      // If there is a code in the OpenID Connect response, redeem it for an access token and refresh token, and store those away. 
      AuthorizationCodeReceived = (context) => 
      { 
       var code = context.Code; 
       ClientCredential credential = new ClientCredential(clientId, appKey); 
       string signedInUserID = context.AuthenticationTicket.Identity.FindFirst(ClaimTypes.NameIdentifier).Value; 
       AuthenticationContext authContext = new AuthenticationContext(Authority, new ADALTokenCache(signedInUserID)); 
       AuthenticationResult result = authContext.AcquireTokenByAuthorizationCode(code, new Uri(redirectUri), credential, graphResourceId); 

       return Task.FromResult(0); 
      }, 

      RedirectToIdentityProvider = (context) => 
      { 
       context.ProtocolMessage.RedirectUri = redirectUri; 
       context.ProtocolMessage.PostLogoutRedirectUri = redirectUri; 

       return Task.FromResult(0); 
      } 
     }, 
    } 
); 

注:このコードはあるがcを使用するASP.NET MVCアプリケーションで使用されます。 ookieベースの認証。

関連する問題