Skip to content

[🐛] signInWithPopup using OAuthProvider throws "unable to process request due to missing initial state" error #8464

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

Open
AshutoshGeekyAnts opened this issue Apr 11, 2025 · 1 comment

Comments

@AshutoshGeekyAnts
Copy link

AshutoshGeekyAnts commented Apr 11, 2025

I'm using react-native-firebase with Firebase Authentication and trying to sign in using an OIDC OAuthProvider. My setup looks like this:

const provider = new auth.OAuthProvider('oidc.my_app')

provider.setCustomParameters({ organization: 'org_##############', })

const res = await auth().signInWithPopup(provider)

However, when calling signInWithPopup, I receive the following error:

unable to process request due to missing initial state. This may happen if browser sessionStorage is inaccessible or accidentally cleared.

Expected behavior: The OIDC provider flow should initiate the popup authentication and return user credentials upon successful login.

occurrence: this issue occurs sometimes. not able to get reproduction steps. no fixed period of time sometimes on the first login and sometimes while second login sometimes does not occur.

Observed behavior: An error is thrown immediately, and the sign-in process does not begin. It mentions an issue with sessionStorage, which seems to reference a browser-specific mechanism.

Environment:

React Native Firebase Auth Version: 18.7.3

React Native Version: 0.71.13

Firebase project is using a custom OIDC provider

Platform: iOS

Firebase JS SDK or RN Firebase SDK being used

Notes:

This error seems to stem from internal Firebase web SDK behavior (mention of sessionStorage) and may not be applicable to a React Native context.

Would appreciate clarification on whether signInWithPopup is expected to work in React Native with custom OIDC providers, and if not, what the recommended integration flow is.

screenshot:

Image

@MichaelVerdon
Copy link
Collaborator

Hey there, can you please use the latest version v21.3.0 ?

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
@MichaelVerdon @AshutoshGeekyAnts and others