I'm facing some problems to wrap my mind about oAuth 2.0. Particularly, thephpleague/oauth2-server implementation.
I managed to set up an endpoint to create access tokens using Password grant type. This is, when someone do a POST /auth
, they get the following answer:
{
"access_token": "hleVw03Fx4hVsaCqEmFqcXeks0hsDTkNSxMN17NR",
"token_type": "Bearer",
"expires_in": 3600,
"refresh_token": "GD8kT7JfGULhUKSTSBsF7AO6NaIXrqPS0dlyQjTm"
}
What I want to do now, is generate a new token when the access_token
gets expired. I understand that I should use the refresh_token
to ask for a fresh new token. However, I didn't find any documentation to start with.