.net - IdentityServer Authentication Endpoint -> error=invalid_request failureReason="STATUS_CODE" -
i implementing sso 1 third-side service. service doesn't support oidc or oauth, need implement proprietary. have middleware, handles requests. when reckognizes request login request third side app, creates authorize link , redirects [identityserver]/connect/authorize, authorize endpoint. server should give me jwt token, process. anyway identity server gives me error , when log file can see failurereason="status_code"
. response.redirect()
sets status code 302, should fine, shouldn't be?
client set fine. using implicit flow. authorizationcode or clientcredentials sends me error page message: client application not known or not authorized. status code 204.
middleware snippet:
string url = $"{context.request.scheme}://{context.request.host}"; discoveryclient discoveryclient = new discoveryclient("https://localhost:44300/"); discoveryresponse doc = await discoveryclient.getasync(); authorizerequest authorizerequest = new authorizerequest(doc.authorizeendpoint); string authorizeurl = authorizerequest.createauthorizeurl( clientid: "zendesk", responsetype: "id_token token", scope: "openid email profile", redirecturi: $"{url}/zendesk/authenticated", state: base64url.encode(returnto.tobytes())); context.response.redirect(authorizeurl); return;
redirected link:
result link:
https://localhost:44327/zendesk/authenticated#error=invalid_request&state=[64encodedvalue]
thanks hint, in dead end here.
i got log contained helpful message:
nonce required implicit , hybrid flow openid scope { ... , "subjectid": "unknown", "responsetype": "id_token token", "responsemode": "form_post", "flow": "implicit", "requestedscopes": "openid email profile", "state": "...", "raw": { "client_id": "...", "response_type": "id_token token", "scope": "openid email profile", "redirect_uri": "...", "state": "...", "response_mode": "form_post" }
and decided use other flow anyway.
Comments
Post a Comment