access_token audience is not for this project

See original GitHub issue

So I’m trying to signIn with but I’m getting the following error: access_token audience is not for this project

Here is my code:

GoogleSignin.signIn()
      .then((user) => {
        const credential = this.props.firebase.auth.GoogleAuthProvider.credential(null, user.accessToken);
        this.props.firebase.auth().signInWithCredential(credential)
            .then((user) => {
                alert("We did it!!")
                console.log('User successfully signed in', user)
            })
            .catch((err) => {
                alert("Fuck!! " + err)
                console.error(err);
            });
      })
      .catch((err) => {
         alert("err " + err)
      })
      .done()

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:4
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

13reactions
gunsymcommented, Aug 10, 2020

Hi guys, in case anyone is still having this error “access token is not for this project”, mine was fixed by adding Whitelist client IDs in Firebase Console with that found in the google-services.json file. Hope this helps someone.

google

4reactions
egunsomacommented, Apr 14, 2018

SOLVED for me. I have two Firebase projects, one for development, and one for production. The development config has the SHA-1 for the debug build, and the production config has the SHA-1 for the release build. This error only occurred when I was using the the debug build with the prod config.

So the problem was that my build’s SHA-1 fingerprint didn’t match the one in Firebase project, but not because of the config. It was my build variant.

Hope this helps you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

access_token audience is not for this project #300 - GitHub
Hi guys, in case anyone is still having this error "access token is not for this project", mine was fixed by adding Whitelist...
Read more >
access_token audience is not for this project - Stack Overflow
I`m getting 'access_token audience is not for this project' error while trying to authenticate from google via firebase
Read more >
Authenticating service-to-service | Cloud Run Documentation
Once the calling service account has been granted the proper role, you need to: Fetch a Google-signed ID token with the audience claim...
Read more >
ID Token and Access Token: What Is the Difference? - Auth0
If your API accepts an ID token as an authorization token, to begin with, you are ignoring the intended recipient stated by the...
Read more >
Microsoft identity platform access tokens
Learn about access tokens emitted by the Azure AD v1.0 and Microsoft identity platform (v2.0) endpoints.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found