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

What is the full curl command to get access token with request token? #86

Open
lgprobert opened this issue Jan 10, 2022 · 2 comments
Open

Comments

@lgprobert
Copy link

lgprobert commented Jan 10, 2022

Hi,
The sample in this repo is pretty straightforward and clear. Thanks.

One thing is not mentioned in tutorial is getting new access_token with refresh_token as way of renewing an access_token.

I tried below command and the other which had auth tuple and both failed.

$ curl -XPOST http://127.0.0.1:8000/oauth/token -F grant_type=refresh_token -F refresh_token=NogJYgBFjH3NmTBDHdDYTCUQBQaMXBFZThdjaHtjraEuT9HM
{"error": "invalid_client"}

The other test is adding client_id and cilent_secret:

curl -u ${client_id}:${client_secret} -XPOST http://127.0.0.1:8000/oauth/token -F grant_type=refresh_token -F scope=profile -F refresh_token=${refresh_token}
{"error": "unauthorized_client"}

What is the correct curl command to get access token with refresh token?

Thanks

@nicksonthc
Copy link

nicksonthc commented Oct 25, 2022

The full command should be like below , you need get your client id, client secret and username from the sqlite.

  1. id
  2. secret
  3. username

curl -u iuDsNl5kBL6dxaVWdIUtU53z:IFlpm1up7drF50wdSfceB29PSGX3geqQG683ReI8NzR0BZV7 -XPOST http://127.0.0.1:5000/oauth/token -F grant_type=password -F username=$nicksonthc -F password=valid -F scope=profile

The sqlite database store under folder instance , you can download vscode extension sqlite to browse the row after you create your client via 127.0.0.1:5000

image

@Abhishekeyespace
Copy link

Hi I am getting similar error:

curl -u "${CLIENT_ID}:${CLIENT_SECRET}" -XPOST http://127.0.0.1:5000/oauth/token -F grant_type=authorization_code -F code=RSv6j745Ri0DhBSvi2RQu5JKpIVvLm8SFd5ObjOZZSijohe0

{"error": "invalid_request", "error_description": "Invalid \"code\" in request."}%

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

3 participants