I use the [simple_oauth][1] module to authenticate the user.
I have generated the first access_token using the grant_type=password.
then I have tried to get a new access_token using my refresh_token received from first request :
POST /oauth/token
grant_type:refresh_token
refresh_token:def50200d3c74fa2e41a886a6ff1...
client_secret:l0r3m1psum
the first time I execute the request it returns the new access_token :
{
"token_type": "Bearer",
"expires_in": 300,
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJS..",
"refresh_token": "def502002b9ce17870bc285427a6.."
}
the problem is the second time I run the same request it Doesn't works and I get 401 unauthorized with this HTML body :
{
"error": "invalid_request",
"error_description": "The refresh token is invalid.",
"hint": "Token has been revoked",
"message": "The refresh token is invalid."
}
for the second request I have used the same refresh_token(I'am sure it not expired I have set ttl to 78000 for test) :
POST /oauth/token
grant_type:refresh_token
refresh_token:def50200d3c74fa2e41a886a6ff1...
client_secret:l0r3m1psum
grant_type:refresh_token request will enable us to get new access_token as long as refresh token not expired?
but it is like getting expires after just executing a request one time , if I generate a new refresh_token using the grant_type:password in my case the grant_type:refresh_token request works fine .
but in [1]: https://www.drupal.org/project/simple_oauth