When I try to get a new access token with my refresh token I always get an invalid_grant error with the following message: Failed to get token: [error: invalid_grant, description: Unknown or invalid refresh token.]
This is the snippet of code that arises the exception (it’s written in dart):
final TokenResponse? response = await appAuth.token(TokenRequest(
Config.AUTH0_CLIENT_ID, Config.AUTH0_REDIRECT_URI,
issuer: 'https://' + Config.AUTH0_DOMAIN,
scopes: <String>['openid', 'profile', 'offline_access', 'email'],
refreshToken: storedRefreshToken,
grantType: GrantType.refreshToken,
allowInsecureConnections: true));
I’m using the HS256 signature algorithm cause the RS256 does not allow me to login.
I also checked the grant types and I’ve got: Implicit, Authorization Code and Refresh Token.
Also tried with absolute expiration time and with rotation.
Why am I still getting the invalid_grant error?