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

This browser is not supported or 3rd party cookies and data may be disabled. #865

Closed
sriramkp opened this issue May 24, 2018 · 7 comments
Closed

Comments

@sriramkp
Copy link

[REQUIRED] Describe your environment

  • Operating System version: Windows 7
  • Firebase SDK version: 5.0.1
  • Firebase Product: auth
  • Browser: Chrome

[REQUIRED] **Login functionality is not working in chrome browser and giving the error message:

{code: "auth/web-storage-unsupported", message: "This browser is not supported or 3rd party cookies and data may be disabled."}

Relevant Code:

private oAuthSignIn(provider) {

    return this.afAuth.auth.signInWithPopup(provider)
      .then((credential) => this.saveUserInfo(credential.user))
      .catch(error => this.handleSignInError(error));
  }

signInWithGoogle() {

    const provider = new firebase.auth.GoogleAuthProvider();
    return this.oAuthSignIn(provider);
  }
@wti806
Copy link
Contributor

wti806 commented May 24, 2018

Did you disable third-party cookie in your chrome settings?

@sriramkp
Copy link
Author

Its disabled, by-default in my browser. It will happen with many other users and we cant ask every user to enable third-party cookie in their browsers. Because of this we will lose some user base.

Kindly let us know how to handle this scenario with any code changes that we can make.

@bojeil-google
Copy link
Contributor

The underlying communication protocol we use depend on this. We have no plans to support this right now.

If this is an issue for you, you can use 3P libraries to get the OAuth credential (for example google sign in library for JS supports this environment) and then sign in to Firebase using the obtained ID token or access token with signInWithCredential or signInAndRetrieveDataWithCredential.

@bpetetot
Copy link

bpetetot commented Jun 4, 2018

I had this issue because I used a custom domain. You have to correctly configure the domain, set it as authDomain and set correct redirect URLs in providers. You can see it in the firebase documentation:

image

https://firebase.google.com/docs/auth/web/google-signin?authuser=0

@bojeil-google
Copy link
Contributor

This is unrelated to authDomain customization. There are many developers that customize their authDomain. This is the first we hear of any 3rd party cookie issues with this.
The issue may be manifesting due to some other problem in your setup.

@hiepxanh
Copy link

hiepxanh commented Dec 24, 2018

@bpetetot you are right if I block only cookie of 1 (the origin), it will show this error
image

@Solan85
Copy link

Solan85 commented Mar 12, 2019

@bpetetot solution is perfect.
If your issue is on localhost you can comfortably disable third party cookies set by *.firebase.com.
If you are looking for a solution on your production environment. Then you need to follow steps provided by @bpetetot, which is also summarized here:
https://firebase.google.com/docs/auth/web/google-signin#customizing-the-redirect-domain-for-google-sign-in
Also you need to connect your firebase host to your custom domain (I am assuming your app is not hosted on firebase hosting and that is only why you are getting this issue.). Follow the steps here:
https://stackoverflow.com/questions/52218777/firebase-auth-customized-redirect-domain-prompts-neterr-cert-common-name-inv#answer-52309442

Good luck!
This issue is old, my post is help for others.

@firebase firebase locked and limited conversation to collaborators Oct 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants