We have been experiencing sporadic drops in our user sessions. We have identified this occurrence to the refreshing our access_token. Below is a a sample payload of what our service receives from Tyk on token refresh:
Any reason as to why Tyk would ever return an empty
- Version: v1.9.1
- Binary: tyk-linux-amd64-126.96.36.199.tar.gz
This looks correct, you are getting a refresh notification and we index based on the refresh token, so you have:
- The new access token (no auth code because that’s not how refresh requests work)
- The refresh token used to get a new token
- The new refresh token to index for when they refresh again
Basically, the client is using the refresh token to generate a new access token, not an auth code - with a refresh request you don’t get a new auth code, you just get an access token.
Only the first auth request will generate an auth_code, but it will get used up as soon as the the client generates its access token and gets a refresh token back, after that it just uses the refresh token.
(Hope that makes sense!)
Thanks for the Response Martin.
If there’s no AuthCode, does that mean the RefreshToken is used as the session identifier and not the authcode ?
The auth code is used in the first interaction, this, when used, generates an access token, the access token is he session identifier.
When the refresh is used, a new access token is generated and hat becomes the session identifier.
To track it back to an identity you will need to track the auth and refresh codes as the notifications come in since the tokens themselves are never re-sent when a session is refreshed.