Reputation: 1195
I'm following Ory Hydra 5 Minute Tutorial.
This tutorial uses a sample Webapp and I'm trying to understand the flow how to convert Code to Token via HTTP POST.
I have several troubles with the POST:
400 Bad Request Request parameter 'grant_type' is missing
400 Bad Request "invalid_grant"
401 Unauthorized "invalid_client"
and it's not clear how to proceed.
Upvotes: 1
Views: 1657
Reputation: 1195
--token-endpoint-auth-method client_secret_post
so that http post is legal later ondocker-compose -f quickstart.yml exec hydra hydra clients create --endpoint http://127.0.0.1:4445 --id helloworld-auth-code-client --secret secret --grant-types authorization_code,refresh_token --response-types code,id_token --scope openid,offline --token-endpoint-auth-method client_secret_post --callbacks http://127.0.0.1:3344/loggedin
Trigger Login
http://127.0.0.1:4444/oauth2/auth?client_id=helloworld-auth-code-client&response_type=code&scope=openid offline&state=hniavseoniasethiohsaent
POST
http://127.0.0.1:4444/oauth2/token
header: Content-Type application/x-www-form-urlencoded
Body: (no curly brackets, just replace the code below and take the following)
response_type=token&grant_type=authorization_code&code=PUTYOURCODEHERE&redirect_uri=http://127.0.0.1:3344/loggedin&client_id=helloworld-auth-code-client&client_secret=secret
Upvotes: 1