2017-10-02 14 views
0

私はidentiyサーバーを使用してアプリケーションを認証しようとしていますが、ログインしようとするとThe client application is not known or is not authorizedと表示されます。リダイレクトする文字列を返す関数を使用して、このエンドポイントと資格情報で認証しようとしています。クライアントの無効なフロー:暗黙的です。 IDサーバーの承認

function create_login_url(){ 
return "indentiy-dev12:8443/connect/authorize?" 
    ."client_id=" ."MyClient". "&" . 
"scope=" . urlencode(openid profile read write email roles) . "&" . 
"redirect_uri=" . "http://localhost:8080/my-page/validate.php" . "&" . 
"response_mode=" . "form_post" . "&" . 
"state=" . time() . rand() . "&" . 
"nonce=" . rand() . time() . "&" . 
"reponse_type=" . urlencode(id_token token); 
} 

クライアントは、この情報を使用して作成されました:

w3wp.exe Information: 0 : [Thinktecture.IdentityServer.Core.Validation.AuthorizeRequestValidator]: 9/25/2017 5:35:14 PM +00:00 -- Start authorize request client validation 
Debug: [Cache]: 9/25/2017 5:35:14 PM +00:00 -- Cache hit: MyClient 
w3wp.exe Error: 0 : [Thinktecture.IdentityServer.Core.Validation.AuthorizeRequestValidator]: 9/25/2017 5:35:14 PM +00:00 -- Invalid flow for client: Implicit 
{ 
    "ClientId": "MyClient", 
    "ClientName": "My Client", 
    "RedirectUri": "http://localhost:8080/my-page/validate.php", 
    "AllowedRedirectUris": [ 
    "http://192.168.0.30/my-page/validate.php", 
    "http://localhost:8080/my-page/validate.php" 
    ], 
    "SubjectId": "user.fabio", 
    "ResponseType": "id_token token", 
    "ResponseMode": "form_post", 
    "Flow": "Implicit", 
    "RequestedScopes": "openid profile read write email roles", 
    "State": "15063609141165646676", 
    "Nonce": "15954663491506360914", 
    "SessionId": "33e89e5746b59e895c5d6edf6b5220b4", 
    "Raw": { 
    "client_id": "MyClient", 
    "scope": "openid profile read write email roles", 
    "redirect_uri": "http://localhost:8080/my-page/validate.php", 
    "response_mode": "form_post", 
    "state": "15063609141165646676", 
    "nonce": "15954663491506360914", 
    "response_type": "id_token token" 
    } 
} 
w3wp.exe Information: 0 : [Events]: 9/25/2017 5:35:14 PM +00:00 -- { 
    "Category": "Endpoints", 
    "Name": "Endpoint failure", 
    "EventType": "Failure", 
    "Id": 3001, 
    "Message": "unauthorized_client", 
    "Details": { 
    "EndpointName": "authorize" 
    }, 
    "Context": { 
    "ActivityId": "c30c1550-4cf7-4527-8d09-b42e2557ffaa", 
    "TimeStamp": "2017-09-25T17:35:14.1943477+00:00", 
    "ProcessId": 696, 
    "MachineName": "machine-name", 
    "RemoteIpAddress": "192.168.70.28", 
    "SubjectId": "user.fabio" 
    } 
} 
w3wp.exe Information: 0 : [Thinktecture.IdentityServer.Core.Endpoints.AuthorizeEndpointController]: 9/25/2017 5:35:14 PM +00:00 -- End authorize request 
w3wp.exe Warning: 0 : [Thinktecture.IdentityServer.Core.Configuration.IdentityServerServiceFactory]: 9/25/2017 6:33:38 PM +00:00 -- AuthorizationCodeStore not configured - falling back to InMemory 
w3wp.exe Warning: 0 : [Thinktecture.IdentityServer.Core.Configuration.IdentityServerServiceFactory]: 9/25/2017 6:33:38 PM +00:00 -- TokenHandleStore not configured - falling back to InMemory 
w3wp.exe Warning: 0 : [Thinktecture.IdentityServer.Core.Configuration.IdentityServerServiceFactory]: 9/25/2017 6:33:38 PM +00:00 -- ConsentStore not configured - falling back to InMemory 
w3wp.exe Warning: 0 : [Thinktecture.IdentityServer.Core.Configuration.IdentityServerServiceFactory]: 9/25/2017 6:33:38 PM +00:00 -- RefreshTokenStore not configured - falling back to InMemory 
w3wp.exe Information: 0 : [Events]: 9/25/2017 6:33:39 PM +00:00 -- { 
    "Category": "Information", 
    "Name": "Signing certificate validation success", 
    "EventType": "Information", 
    "Id": 4012, 
    "Details": { 
    "SigningCertificateName": "CN=idsrv3test", 
    "SigningCertificateExpiration": "2020-01-20T16:00:00-06:00" 
    }, 
    "Context": { 
    "TimeStamp": "2017-09-25T18:33:39.0033098+00:00", 
    "ProcessId": 8468, 
    "MachineName": "machine-name" 
    } 
} 

私がログインしようとしているサーバーは、自分のPCではありません。

 { 
      ClientName = "My Client", 
      Enabled = true, 
      ClientId = "MyClient", 
      ClientSecrets = new List<ClientSecret> 
      { 
       new ClientSecret("MyClient".Sha256()) 
      }, 
      RedirectUris = new List<string> 
      { 
       "http://192.168.0.30/my-page/validate.php", 
       "http://localhost:8080/my-page/validate.php", 
      }, 

      PostLogoutRedirectUris = new List<string> 
      { 
       "http://192.168.0.30/my-page/validate.php", 
       "http://localhost:8080/my-page/validate.php", 
      }, 

      Flow = Flows.ResourceOwner 
     } 

これは、ログが言うことです。正常にログインできる別のクライアントがあります。

答えて

0

あなたのログイン要求は、アイデンティティトークンとアクセストークンを要求しています。これは、暗黙の付与タイプに変換されます。

ただし、クライアントエントリはROPC許可タイプ用に設定されています。 ROPCはであり、実際には認証でもOpenID Connectでもないので、IDトークンを使用することはできません。このため、IdentityServerからエラーメッセージが表示されます。あなたは、クライアントを変更する必要があります

Flows.Implicit

P.S.に流れます本当に古いバージョンのIdentityServerを使用しているようです。彼らは数年前にThinktectureプレフィックスを削除しました。それを調べたいかもしれません。

+0

問題は、このフローを使用している他のクライアントが存在していることです。それ以外は何もできませんか? –

+0

リクエストは次のようになります:https://tools.ietf.org/html/rfc6749#section-4.3.1、あなたはhttp://openid.net/specs/openid-connect-core-1_0のように見えます.html#ImplicitAuthRequest –

+0

あなたが提供した情報を使用して、これ以外に何もできません。 –

関連する問題