-
Notifications
You must be signed in to change notification settings - Fork 442
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Authorize()'s refreshToken expiry #1018
Comments
The expiration times of tokens are controlled by your provider, in this case Azure. Try inspecting both tokens by pasting them into https://jwt.io/ and looking at the data inside the token, which could be helpful in determining the problem. The |
I've tried inspecting the refreshToken via https://jwt.io but it returns this invalid payload. |
The data you posted looks like an access exchange token and not a JWT, or possible an encrypted JWT. What does your configuration for RNAA look like? |
Issue
Hi, I've read the documentation for authorization function of this library (https://commerce.nearform.com/open-source/react-native-app-auth/docs/usage/authorization).
The response contains the expiration only for the accessToken and not for the refreshToken. Can you tell how much time does the refreshToken has before it expires as well?
I am asking because currently I am in a situation that I need the refreshToken from authorize(config) to be used on refresh() like the next code snippet for my Azure Active Directory login.
// Refresh token
const refreshedState = await refresh(config, { refreshToken: authState.refreshToken, });
But the problem is, when I use the
authState.refreshToken
when theauthState.accessToken
from authorize(config) has expired, refresh(config) fails. But as long as theauthState.accessToken
is not yet expired, the refresh(config) call returns a successful response.I'm thinking if the
authState.refreshToken
is being expired the same time asauthState.accessToken
. Because refresh(config) fails only when theauthState.accessToken
has expired.Environment
react-native
Version: 0.69.2react-native-app-auth
Version: 6.0.2The text was updated successfully, but these errors were encountered: