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

MISSING_OR_INVALID_NONCE : The nonce in ID Token does not match the SHA256 hash of the raw nonce in the request #8207

Open
adityapol7711 opened this issue Apr 26, 2024 · 0 comments

Comments

@adityapol7711
Copy link

adityapol7711 commented Apr 26, 2024

Operating System

windows10

Browser Version

chrome

Firebase SDK Version

1.7.2

Firebase SDK Product:

Auth

Describe your project's tooling

Angular 16 single page application

Describe the problem

I am trying to authenticate into firebase using keycloak as OIDC. I am using authorization code flow of the firebase configuration. Below is the code that I have written for the same.

Upon calling this block of code I'm getting following error "MISSING_OR_INVALID_NONCE : The nonce in ID Token does not match the SHA256 hash of the raw nonce in the request.". If anyone from the community knows, any guidance would be appreciated.

I have tried adding rawNonce field but it's giving the same error, also I tried disabling the NONCE field from the keycloak dashboard.

Steps and code to reproduce issue

const provider = new OAuthProvider('oidc.kc-dev');

const credential = provider.credential({
  idToken: id_token
  accessToken: access,
});

signInWithCredential(getAuth(), credential)
  .then((result: any) => {
    // Get the OAuth access token and ID Token
    const credential1 = OAuthProvider.credentialFromResult(result);
    console.log(credential1);
  })
  .catch((error: any) => {
    // Handle error.
  });
@adityapol7711 adityapol7711 added new A new issue that hasn't be categoirzed as question, bug or feature request question labels Apr 26, 2024
@jbalidiong jbalidiong added needs-attention and removed new A new issue that hasn't be categoirzed as question, bug or feature request labels Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants