Skip to content

Authorize()'s refreshToken expiry #1018

Open
@captainalbert

Description

@captainalbert

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 the authState.accessToken from authorize(config) has expired, refresh(config) fails. But as long as the authState.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 as authState.accessToken. Because refresh(config) fails only when the authState.accessToken has expired.


Environment

  • Your Identity Provider: Azure
  • Platform that you're experiencing the issue on: Tested on Android only yet
  • Your react-native Version: 0.69.2
  • Your react-native-app-auth Version: 6.0.2
  • Are you using Expo? No

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions