To obtain refresh token and then to get a refreshed access_token follow these steps:
- At the beginning of authorization step of client in scope add "offline_access". i.e
- When you obtain code from previous call you can call
- POST: /connect/token
HOST: https://identity.justgiving.com
Authorization: Basic {yourBase64EncodedCredentials}
Encoded form parameters :- grant_type = authorization_code
- code = code_from_previous_call
- redirect_uri = redirects_uri
- Response should be :
"{\"id_token\":\"Very long token\",\"access_token\":\"access token to use for api call\",\"expires_in\":3600,\"token_type\":\"Bearer\",\"refresh_token\":\"refresh token required for next call\"}"
- POST: /connect/token
- Now if you have refresh_token you can call :
- POST: /connect/token
HOST: https://identity.justgiving.com
Authorization: Basic {yourBase64EncodedCredentials}
Encoded form parameters :
- grant_type = refresh_token
- refresh_token = token from previous call
- redirect_uri = redirect uri
- Response should be :
"{\"access_token\":\"new access token to use for consequent api calls\",\"expires_in\":3600,\"token_type\":\"Bearer\",\"refresh_token\":\"new refresh token to be used when next refreshing the token\"}"
- POST: /connect/token
Refresh tokens last 365 days.
0 Comments