2017-10-02 4 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

로그인 요청에서 ID 토큰 및 액세스 토큰을 요청합니다. 이것은 암시 적 부여 유형으로 변환됩니다.

그러나 클라이언트 항목은 ROPC 부여 유형으로 구성됩니다. ROPC는 인증이 아니며 OpenID Connect도 아니므로 ID 토큰을 사용할 수 없습니다. 이것이 IdentityServer에서 오류 메시지를받는 이유입니다.

당신은 클라이언트가 Flows.Implicit

P.S.에 흐름을 변경해야합니다 정말 오래된 버전의 IdentityServer를 사용하고있는 것 같습니다. 그들은 수년 전 Thinktecture 접두어를 삭제했습니다. 그걸 들여다 볼 수도 있습니다.

+0

이 흐름을 사용하는 다른 클라이언트가 있고 그 (것)들을 위해 작동한다이다. 다른 건 없어요? –

+0

요청은 http://openid.net/specs/openid-connect-core-1_0처럼 보이는 반면 https://tools.ietf.org/html/rfc6749#section-4.3.1과 같습니다. .html # ImplicitAuthRequest –

+0

제공하신 정보를 사용하여 다른 어떤 것도 할 수 없습니다. –