我在跟踪奥利九头蛇5分钟教程。
本教程使用一个示例Webapp,我试图了解如何通过HTTP将代码转换为令牌的流程。
我在这篇文章上有几个问题:
400 Bad Request Request parameter 'grant_type' is missing
400 Bad Request "invalid_grant"
401 Unauthorized "invalid_client"
现在还不清楚该怎么做。
发布于 2022-01-20 15:08:43
客户端创建
--token-endpoint-auth-method client_secret_post,以便http在以后成为合法docker-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登录和检索代码
触发器登录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=secrethttps://stackoverflow.com/questions/70788098
复制相似问题