2016-08-02 8 views
0

認証するためにIdentityServer3を使用するようにクライアントアプリケーションport3gを設定しています。Identityserver3 - クライアントアプリケーションが認識されていないか、認証されていません

エラーが発生します。クライアントアプリケーションが認識されていないか、許可されていません。 クライアントとOAuthサーバーの両方のクライアント設定が正しく構成されていると思います。 PORT3G起動が..

public void ConfigureAuth(IAppBuilder app) 
    { 
     JwtSecurityTokenHandler.InboundClaimTypeMap = new Dictionary<string, string>(); 

     app.UseCookieAuthentication(new CookieAuthenticationOptions 
     { 
      AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie 
     }); 
     //port3g_implicit 


     app.UseOpenIdConnectAuthentication(new OpenIdConnectAuthenticationOptions 
     { 
      ClientId = "port3g_implicit", 
      Authority = "http://localhost:22710", // Authorization Server 
      RedirectUri = "http://localhost:28037/", // Address of this website 
      ResponseType = "id_token token ", // Added token was not in orginal code 
      Scope = "openid profile offline_access read appRoles", 
      PostLogoutRedirectUri = "http://localhost:28037", 
      SignInAsAuthenticationType = DefaultAuthenticationTypes.ApplicationCookie 
     }); 

    } 

SITE:Webhost.OAuth

// BEGIN PORT3G 
      new Client 
      { 
       ClientId = "port3g_implicit", 
       ClientSecrets = new List<Secret> 
       { 
        new Secret("secret".Sha256()) 
       }, 
       ClientName = "Port3G", 
       Flow = Flows.Implicit, 
       AllowedScopes = new List<string> 
       { 
        Constants.StandardScopes.OpenId, 
        Constants.StandardScopes.Profile,Constants.StandardScopes.AllClaims , 
        "read","appRoles" 
       }, 
       RedirectUris = new List<string> 
       { 
        "http://localhost:28037/", 
        "http://localhost:28037/" 
       }, 
       PostLogoutRedirectUris = new List<string> 
       { 
        "http://localhost:28037/" 
       }, 
       Enabled = true 
      } 
      // END PORT3G 

答えて

0

ResponseType = "id_token token ", // Added token was not in orginal code 

削除してみてください。 offline_accessのスコープも削除してください

3

はあなたがIdentityServer loggingをオンにしました誰もが設定

SITEのいずれかのエラーを参照していますか?この種の問題を診断するのに非常に役立つことがあります。

この特定のケースでは、暗黙のフローでは許可されていないoffline_accessを要求している可能性があります。スコープに割り当てられた文字列からその識別子を削除してみてください。許可されていない

[エラー]要求されたスコープ:あなたはログオン電源を入れたとき、あなたはおそらく、この問題を示す次の行が表示されます「offline_access」あなたの応答タイプの末尾にスペースがあり

関連する問題