2

I have two Firebase projects, with one I can login using Google auth, no problem. But the other gives me this error. I can't find any difference in settings between the two. With both, I'm running the project and logging in from localhost.

Error getting access token from GOOGLE_OIDC, request is: https://www.googleapis.com/oauth2/v3/token?grant_type=authorization_code&client_id=385081226950-opume6j1nqt3rk9einrdjldpqnhvkjcl.apps.googleusercontent.com&code=4/1gDYKHBbne2u_R9AAl6lzumwLPRn2EdmfMWQmpKI8nt4SoglhG9ov1uBGDagvMFwQhUAqzYXp8yeQCNAemqjVEI&redirect_uri=https://stokebrain-local.firebaseapp.com/__/auth/handler, response is: OAuth2TokenResponse{params: error=invalid_client&error_description=Unauthorized, httpMetadata: HttpMetadata{status=401, cachePolicy=NO_CACHE, cacheDuration=null, cacheImmutable=false, staleWhileRevalidate=null, filename=null, lastModified=null, headers=HTTP/1.1 200 OK

, cookieList=[]}}

1 Answer 1

4

Okay, solved finally.

Go to Firebase console: https://console.firebase.google.com/u/0/project/-your-project-id-/authentication/providers

Sign-in Method -> Google -> Edit (pencil icon) -> Web client secret

For me, Web client secret was wrong. Above, next to "Web SDK configuration", mouse over info icon, click the link for "Google API Console". Near the top of this page you'll find the Web client secret, copy and paste into Firebase. Auth should now work.

1
  • Life saver! I spent a few hours trying to figure out to no avail what was going wrong until I found your post!
    – Va5ili5
    Feb 14, 2021 at 12:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .