You may need a new Access Tokens because:
Issuing a Refresh Token is OPTIONAL at the discretion of the Authorization Server.
If the Authorization Server issues a Refresh Token, it is included when issuing an Access Token
A Refresh Token is a string representing the authorization granted to the OAuth Client by the Resource Owner.
The Refresh Token is usually opaque to the OAuth Client.
The Refresh Token denotes an identifier used to retrieve the Authorization information.
Refresh Token usually require a check against the Authorization Server.
Unlike Access Tokens, Refresh Tokens are intended for use only with Authorization Servers and are never sent to Resource Servers.
OAuth 2.0 specifications specifically state:
Refresh Token must be issued to a single authenticated OAuth Client to prevent use of leaked tokens by other parties.
The Token_endpoint could be (/oauth/token), which handles issuing of all types of grants (access and refresh tokens).
Assuming there is a Resource Owner ‘test‘ with password ‘test‘ and a OAuth Client ‘testclient‘ with a client secret ‘secret‘, a sample Access Token Request of a new Access Token/Refresh Token pair could be the following:
$ curl -X POST -H 'Authorization: Basic dGVzdGNsaWVudDpzZWNyZXQ=' -d 'grant_type=password&username=test&password=test' localhost:3000/oauth/token { "token_type":"bearer", "access_token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyIjoiVlx1MDAxNcKbwoNUwoonbFPCu8KhwrYiLCJpYXQiOjE0NDQyNjI1NDMsImV4cCI6MTQ0NDI2MjU2M30.MldruS1PvZaRZIJR4legQaauQ3_DYKxxP2rFnD37Ip4", "expires_in":20, "refresh_token":"fdb8fdbecf1d03ce5e6125c067733c0d51de209c" }
When a new Access Token is required, you can use the Refresh Token to get a new Access Token by using the token_endpoint as shown below:
$ curl -X POST -H 'Authorization: Basic dGVzdGNsaWVudDpzZWNyZXQ=' -d 'refresh_token=fdb8fdbecf1d03ce5e6125c067733c0d51de209c&grant_type=refresh_token' localhost:3000/oauth/token { "token_type":"bearer", "access_token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyIjoiVlx1MDAxNcKbwoNUwoonbFPCu8KhwrYiLCJpYXQiOjE0NDQyNjI4NjYsImV4cCI6MTQ0NDI2Mjg4Nn0.Dww7TC-d0teDAgsmKHw7bhF2THNichsE6rVJq9xu_2s", "expires_in":20, "refresh_token":"7fd15938c823cf58e78019bea2af142f9449696a" }