问题
Can someone please recommend a resolution to the problem that I am facing in my firebase web application where I am trying out google oath.
here is the snippet of code:
//login with google
const googleButton = document.querySelector('#googleLogin');
googleButton.addEventListener('click', (e)=>{
e.preventDefault();
M.Modal.getInstance(modal).close();
loginForm.reset();
const provider = new firebase.auth.GoogleAuthProvider();
auth.signInWithPopup(provider).then(function(result){
console.log(result);
console.log("Successful Google Sign in");
}).catch(function(error){
console.log(error);
console.log("Login failed");
here is the response payload that I get from the browser:
{
"error": {
"code": 400,
"message": "OPERATION_NOT_ALLOWED : The identity provider configuration is disabled.",
"errors": [
{
"message": "OPERATION_NOT_ALLOWED : The identity provider configuration is disabled.",
"domain": "global",
"reason": "invalid"
}
]
}
}
Instead of a Successful Google Sign in
from the console log, i get :
Storage access automatically granted for tracker “https://nompu-website.firebaseapp.com” on “http://127.0.0.1:5500”.
I have enabled Google as one of the sign in options.
回答1:
I restarted the browser, re-ran the web-application , enabled the Google sign-in method from Firebase console (again) and finally added the authorized domain (127.0.0.0) of type custom to the list of authorized domains. It worked.
来源:https://stackoverflow.com/questions/58064403/recommend-resolution-for-the-error-operation-not-allowed-the-identity-provide