Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem: how to refresh access token with curl command #92

Open
newthis opened this issue Nov 17, 2022 · 4 comments
Open

Problem: how to refresh access token with curl command #92

newthis opened this issue Nov 17, 2022 · 4 comments

Comments

@newthis
Copy link

newthis commented Nov 17, 2022

I have got the access token, so how I refresh it with my refresh_token, what is the correct curl command to get that ?

@newthis
Copy link
Author

newthis commented Nov 17, 2022

My command is :
curl -u a2joef57Z67mdPjKbrgct5Bt:r97JqZJknNF7FMhWBWJXeRTp1mDqdxVeuG7JzjvI2QfrRTHZ -XPOST http://127.0.0.1:5008/oauth/token -d '{"grant_type": "refresh_token", "scope":"profile","refresh_token":"azUoo2nwHX1vEU1YeLYVijkynaPfnojXyKiJ5TXLP7w9MfzD"}

response is: {"error": "unsupported_grant_type"}

@newthis
Copy link
Author

newthis commented Nov 17, 2022

authorization = AuthorizationServer(
query_client=query_client,
save_token=save_token,
)
authorization.register_grant(grants.ImplicitGrant)
authorization.register_grant(grants.ClientCredentialsGrant)
authorization.register_grant(AuthorizationCodeGrant, [CodeChallenge(required=True)])
authorization.register_grant(PasswordGrant)
authorization.register_grant(RefreshTokenGrant),

the code shows that RefreshTokenGrant has been registered.

@lepture
Copy link
Member

lepture commented Nov 18, 2022

Please make sure your register client supports refresh_token grant type.

@newthis
Copy link
Author

newthis commented Nov 21, 2022

yes, I have added this kind of grant type in page, it still does not work.

t1

t2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants