'firebase auth/operation-not-allowed

This is an angular web app.

Added the screenshot of the permission page

I'm trying to authenticate mobile using firebase.

In my firebase console > Authentication > signIn Method, I've enabled the phone and saved it.

But when I try to login It throws me an error saying that auth/operation-not-allowed

sendLoginCode() {
    const appVerifier = this.windowRef.recaptchaVerifier;
    const num = this.firstFormGroup.value.mobileNo
    console.log('num',num);
    firebase.auth().signInWithPhoneNumber(num, appVerifier)
      .then(result => {
             this.windowRef.confirmationResult = result;
        })
      .catch(error => console.log(error));
}
verifyLoginCode() {
    this.windowRef.confirmationResult
      .confirm(this.verificationCode)
      .then(result => {

        this.user = result.user;
        console.log('Login Successfull')

      })
      .catch(error => console.log(error, "Incorrect code entered?"));
  }

https://i.stack.imgur.com/jITY5.png



Solution 1:[1]

It looks like you haven't enabled the Google sign in method in your firebase console. To solve the issue do the following:

  1. Enter to the firebase console (https://console.firebase.google.com/).
  2. Select your project.
  3. On the right side of the screen you'll see a panel, click where it says "Authentication".
  4. Once you've entered to the Authentication menu, go to Sign-in method.
  5. After that look for the google access provider in the list that appears below the header and click on it.
  6. Then click on the enable button.

It is probable that you'll have to configure a secure project ID (you'll see a dropdown below the enable button). What you have to do is, enter the android and/or ios client ID from your project, and hit save. This will tell firebase that it is secure to handle sign in operations with that client.

To be able to use the phone sign in method, you need to have a paid plan active.

Original author of answer: https://stackoverflow.com/a/65598080/6310260

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1