JAN
JAN

Reputation: 21865

REACT - Google & FIREbase Error 403: restricted_client

I've created a Firebase account and connected it with my React code :

enter image description here

I filled all the fields that you can see in the picture above , however when I try to login from my React screen :

enter image description here

When I use it in my React code :

import firebase from "firebase/app";
import "firebase/firestore";
import "firebase/auth";

// Your web app's Firebase configuration
var firebaseConfig = {
  apiKey: "xxxxxxxxxxxx",
  authDomain: "xxxxxxxxxxxx.firebaseapp.com",
  databaseURL: "https://xxxxxxxxxxxx.firebaseio.com",
  projectId: "xxxxxxxxxxx-1e2be",
  storageBucket: "",
  messagingSenderId: "xxxxxxxxxxxxxxxxx",
  appId: "xxxxxxxxxxxxxxxxxx"
};
// Initialize Firebase
firebase.initializeApp(firebaseConfig);

export const auth = firebase.auth();
export const firestore = firebase.firestore();

const provider = new firebase.auth.GoogleAuthProvider();
provider.setCustomParameters({ prompt: 'select_account' });
export const signInWithGoogle = () => auth.signInWithPopup(provider);

export default firebase;

And run it , I get :

t

What might be the problem ? looks like I have all the permissions in tact.

So where did I go wrong ?

EDIT : Sign in method is enabled and still doesn't work!

enter image description here

Upvotes: 0

Views: 849

Answers (2)

Eli Van Rock
Eli Van Rock

Reputation: 157

I had the same issue right now. You did right when you enabled "Google" in the "Sign-In Method" but you probably didn't see the grey panel where you need to input the "Project support email".

Disable, click "Save" and then Enable Again. Afterwards you'll see the grey panel and enter your Google account. And then...the rest is history.

Goodluck Champ!

enter image description here

Upvotes: 2

Aleks
Aleks

Reputation: 984

You have to enable it in Firebase console => Authentication tab => Sign-in method

Upvotes: 0

Related Questions