Reputation: 38985
I am using auth 2.0 to design an api(Resource Owner Password Credentials Model), now I was wonder if the refresh token expired or invalid, what should the client do? the client redirect to the login page or just invoke the get refresh token api with appId&appSecret and refresh token silently?
Upvotes: 0
Views: 1945
Reputation: 138
This is a list of points that you must take in concideration before designing your api:
The resource owner password credentials :
If your IDP accept the refresh token you need to send a request with thoses parametres:
curl --request POST \
--url 'https://YOUR_DOMAIN/oauth/token' \
--header 'content-type: application/x-www-form-urlencoded' \
--data grant_type=refresh_token \
--data 'client_id=YOUR_CLIENT_ID' \
--data refresh_token=YOUR_REFRESH_TOKEN
If not you can do a request to renew the token like the first time.
Now for your question the refresh token will never be expire if the flow is correctly implemented and this is how it work:
Upvotes: 1
Reputation: 2755
In case refresh token
expired, the fresh flow should be initiated where resouce owner will provide their credentials details to the client. Also, this grant type should only be used where resouce owner
has a highly trust relationship with the client, obviously owner is sharing their credentials with the client.
Upvotes: 1