Skip to content
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

token_failed, Failed to get token #482

Open
itskgore opened this issue Feb 20, 2024 · 4 comments
Open

token_failed, Failed to get token #482

itskgore opened this issue Feb 20, 2024 · 4 comments

Comments

@itskgore
Copy link

I'm getting the following error after 3 attempts of a successful token refresh method calls in the 4th attempt I'm getting the following error:

PlatformException(token_failed, Failed to get token: invalid_grant: The refresh token is invalid or expired., null, null)

I'm using OKTA for OAuth.

This is my method:

final oktaRefresh = await appAuth.token(TokenRequest(
            '${Repository.env!['OKTACLIENTID']}',
            '${Repository.env!['OKTAREDIRECTURL']}',
            discoveryUrl:
                'https://${Repository.env!['OKTADOMAIN']}/oauth2/${Repository.env!['OKTAUTHORIZER']}/.well-known/openid-configuration',
            refreshToken: refreshToken,
            grantType: "refresh_token",
            scopes: ["openid", "profile", "offline_access"]));
@d2square
Copy link

I am encountering the same issue and am unable to determine whether it originates from the Okta console or the app itself

@mackayn
Copy link

mackayn commented Feb 22, 2024

I'm getting the following error after 3 attempts of a successful token refresh method calls in the 4th attempt I'm getting the following error:

PlatformException(token_failed, Failed to get token: invalid_grant: The refresh token is invalid or expired., null, null)

I'm using OKTA for OAuth.

This is my method:

final oktaRefresh = await appAuth.token(TokenRequest(
            '${Repository.env!['OKTACLIENTID']}',
            '${Repository.env!['OKTAREDIRECTURL']}',
            discoveryUrl:
                'https://${Repository.env!['OKTADOMAIN']}/oauth2/${Repository.env!['OKTAUTHORIZER']}/.well-known/openid-configuration',
            refreshToken: refreshToken,
            grantType: "refresh_token",
            scopes: ["openid", "profile", "offline_access"]));

Are you seeing this on Android only or iOS and Android, noticed today the 1st token refresh on Android in a B2C flow is throwing this error and the 2nd attempt works but on iOS it works fine

@itskgore
Copy link
Author

@MaikuB I've tried this but no luck,
Also, this is coming for iOS for 3rd time only the first 2 times it works fine.

@shaz-tech
Copy link

Facing same issue. Any progress?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants