Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Firebase Authentication Error: SMS Verification Fails with Code 17006 - "This operation is not allowed" #17070

Open
1 task done
UmerAbbasi1515 opened this issue Feb 10, 2025 · 6 comments
Labels
blocked: customer-response Waiting for customer response, e.g. more information was requested. platform: android Issues / PRs which are specifically for Android. plugin: auth type: bug Something isn't working

Comments

@UmerAbbasi1515
Copy link

UmerAbbasi1515 commented Feb 10, 2025

Is there an existing issue for this?

  • I have searched the existing issues.

Which plugins are affected?

Auth

Which platforms are affected?

Android

Description

I am encountering an issue when attempting to perform phone number authentication using Firebase Auth in my Flutter application.

The SMS verification request fails with the following error:
SMS verification code request failed: unknown status code: 17006 null
D/FirebaseAuth: Invoking original failure callbacks after phone verification failure for UAE number, error - This operation is not allowed. This may be because the given sign-in provider is disabled for this Firebase project. Enable it in the Firebase console, under the sign-in method tab of the Auth section.
[firebase_auth/operation-not-allowed] This operation is not allowed. This may be because the given sign-in provider is disabled for this Firebase project. Enable it in the Firebase console, under the sign-in method tab of the Auth section.

Steps I’ve already taken:
1- I've verified that phone authentication is enabled in the Firebase console under the Authentication > Sign-in method tab.
2- I ensured that the Firebase project is properly linked with the Flutter app and the correct dependencies (firebase_auth: ^4.1.0, firebase_core: ^2.15.0) are installed and also iOS application working fine.
3- I have checked for any errors in the Firebase configuration or setup within the app, but everything seems correct.
4- I also "Start with 'Allow' to limit SMS usage to selected regions" under Authentication -> Settings tab in firebase console.

Has anyone else encountered this issue or know how to resolve it? Any insights on what might be causing the "This operation is not allowed" error, or what additional steps I might be missing would be greatly appreciated.

Reproducing the issue

Android app

Firebase Core version

^2.15.0

Flutter Version

3.27.0

Relevant Log Output

D/FirebaseAuth: Invoking original failure callbacks after phone verification failure for UAE number, error - This operation is not allowed. This may be because the given sign-in provider is disabled for this Firebase project. Enable it in the Firebase console, under the sign-in method tab of the Auth section.
[firebase_auth/operation-not-allowed] This operation is not allowed. This may be because the given sign-in provider is disabled for this Firebase project. Enable it in the Firebase console, under the sign-in method tab of the Auth section.

Flutter dependencies

Expand Flutter dependencies snippet
Replace this line with the contents of your `flutter pub deps -- --style=compact`.

Additional context and comments

No response

@UmerAbbasi1515 UmerAbbasi1515 added Needs Attention This issue needs maintainer attention. type: bug Something isn't working labels Feb 10, 2025
@SelaseKay
Copy link
Contributor

Hi @UmerAbbasi1515, I recommend updating your firebase_auth and firebase_core packages to the latest versions and trying again. Also, make sure you've added the region you're testing from. The interface for this should look like the image attached below.

Image

@SelaseKay SelaseKay added blocked: customer-response Waiting for customer response, e.g. more information was requested. plugin: auth platform: android Issues / PRs which are specifically for Android. and removed Needs Attention This issue needs maintainer attention. labels Feb 10, 2025
@UmerAbbasi1515
Copy link
Author

@SelaseKay
Just to let you know, I have already updated both packages. Additionally, the SMS region policy is the same as you mentioned.

@google-oss-bot google-oss-bot added Needs Attention This issue needs maintainer attention. and removed blocked: customer-response Waiting for customer response, e.g. more information was requested. labels Feb 11, 2025
@SelaseKay
Copy link
Contributor

I have a few questions:

  • Does it work correctly with test numbers as described here?
  • Are you experiencing this issue on a physical device or an emulator?
  • Have you set up the SHA fingerprint in the Firebase console for Android? This is required for phone authentication to function properly.

@SelaseKay SelaseKay added blocked: customer-response Waiting for customer response, e.g. more information was requested. and removed Needs Attention This issue needs maintainer attention. labels Feb 11, 2025
@UmerAbbasi1515
Copy link
Author

UmerAbbasi1515 commented Feb 11, 2025 via email

@google-oss-bot google-oss-bot added Needs Attention This issue needs maintainer attention. and removed blocked: customer-response Waiting for customer response, e.g. more information was requested. labels Feb 11, 2025
@UmerAbbasi1515
Copy link
Author

?

@SelaseKay
Copy link
Contributor

Hi @UmerAbbasi1515, I'm unable to reproduce this issue with the firebase_auth example app. Kindly share a complete minimal repository which reproduces this issue.

@SelaseKay SelaseKay added blocked: customer-response Waiting for customer response, e.g. more information was requested. and removed Needs Attention This issue needs maintainer attention. labels Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked: customer-response Waiting for customer response, e.g. more information was requested. platform: android Issues / PRs which are specifically for Android. plugin: auth type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants