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

OktaAuth.TokenApi.getWithoutPrompt() does not catch error with incorrect clientIdTokenParams.clientId #1423

Open
danielfyo opened this issue Jun 28, 2023 · 1 comment
Labels

Comments

@danielfyo
Copy link

Describe the bug

Hello @pawitp @cmatheson @Almad @bdemers @robertjd,

I have a situation trying to retrieve tokens using getWithoutPrompt when the clientId used to set up the OktaAuth is incorrect, token.getWithoutPrompt() is not being resolved nor rejected, it looks like is because of the iframe you use to retrieve the tokens.

For example,

this.authClient = new OktaAuth({
issuer: process.env.REACT_APP_OKTA_TOKEN_ISSUER,
clientId: process.env.BAD_OKTA_CLIENT_ID,
redirectUri: window.location.origin + "/sign-in/callback",
pkce: true,
});

this.authClient.token
.getWithoutPrompt()
.then((res) => console.log('res', res))
.catch((error) => console.log('error', error));

In the code above, the then and catch blocks are never executed.

Reproduction Steps?

  1. Configure OktaAuth with an invalid clientId
  2. Call getWithoutPrompt
  3. Then and catch blocks are never executed

SDK Versions

@okta/okta-auth-js 7.3.0

Additional Information?

it seems like is a known issue
#1018

@danielfyo danielfyo added the bug label Jun 28, 2023
@lesterchoi-okta
Copy link
Contributor

internal ref OKTA-624378

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

No branches or pull requests

2 participants