amazon-cognito-identity-dart-2 icon indicating copy to clipboard operation
amazon-cognito-identity-dart-2 copied to clipboard

`invalid_grant` on refresh token

Open Juliotati opened this issue 2 years ago • 0 comments

Hi, I've been facing an issue when logging in with the same credentials on different devices on mobile. I'm receiving invalid token error message after my token expires, but when I attempt to refresh the user session by doing a post request I get invalid_grant.

Is it possible that different devices are receiving the same refreshToken which causes the issue of invalid_grant as the quoted definition says:

The "invalid_grant" error usually means you tried to use the same authorisation code to get more than one developer token.

Request body:

{
 'grant_type': 'refresh_token',
 'client_id': CLIENT_ID,
 'refresh_token': REFRESH_TOKEN
}

I would be delighted if someone can point out if I'm missing something on the request body or something else.

Thanks

Juliotati avatar Sep 19 '22 10:09 Juliotati