Harish_Madugula
Harish_Madugula

Reputation: 337

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.sstatic.net/jITY5.png

Upvotes: 14

Views: 36869

Answers (2)

ahmnouira
ahmnouira

Reputation: 3401

I forget to enable Sign-in providers in the Firebase console:

firebase

Upvotes: -1

user23349956
user23349956

Reputation: 1

Go to your project in firebase > authentication > Settings > SMS region policy and allow which region you want SMS to be sending OTP in line with app visibility in app store . it worked for me

Upvotes: 0

Related Questions