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

[Bug] How to fix "The given sign-in provider is disabled for this Firebase project. Enable it in the Firebase console" I can't convert an anonymous account to a permanent account #893

Open
11101100 opened this issue Nov 6, 2023 · 2 comments

Comments

@11101100
Copy link

11101100 commented Nov 6, 2023

[REQUIRED] Please fill in the following fields:

  • Unity editor version: 2022.3.10f1.0.16956
  • Firebase Unity SDK version: 11.6.0
  • Source you installed the SDK: .unitypackage (.unitypackage or Unity Package Manager)
  • Problematic Firebase Component: Auth (Auth, Database, etc.)
  • Other Firebase Components in use: Database(Auth, Database, etc.)
  • Additional SDKs you are using: _____ (Facebook, AdMob, etc.)
  • Platform you are using the Unity editor on: Windows(Mac, Windows, or Linux)
  • Platform you are targeting: Android(iOS, Android, and/or desktop)
  • Scripting Runtime: IL2CPP (Mono, and/or IL2CPP)
  • Pre-built SDK from the website or open-source from this repo: _____

[REQUIRED] Please describe the question here:

I have a problem using LinkWithCredentialAsync
Can you tell me how to Convert an anonymous account to a permanent account in unity? Thank
image

public async Task ConvertUserWithEmail(string email, string password)
{
    Firebase.Auth.FirebaseUser currentUser = Firebase.Auth.FirebaseAuth.DefaultInstance.CurrentUser;
    if (currentUser != null)
    {
        try
        {
            Firebase.Auth.Credential credential = Firebase.Auth.EmailAuthProvider.GetCredential(email, password);
            await currentUser.LinkWithCredentialAsync(credential);   //(cs:1881))
            warningText.text = "IsCompleted";
        }
        catch (Exception e)
        {
            Debug.Log(e);
            warningText.text = e.ToString();
        }
    }
    else
    {
        Debug.Log("Failed");
    }
}

test on windows error

USE_AUTH_EMULATOR not set.
UnityEngine.Debug:Log (object)
Firebase.Platform.FirebaseLogger:LogMessage (Firebase.Platform.PlatformLogLevel,string) (at /Users/runner/work/firebase-unity-sdk/firebase-unity-sdk/app/platform/Unity/FirebaseLogger.cs:89)
Firebase.LogUtil:LogMessage (Firebase.LogLevel,string) (at /Users/runner/work/firebase-unity-sdk/firebase-unity-sdk/app/src/LogUtil.cs:69)
Firebase.LogUtil:LogMessageFromCallback (Firebase.LogLevel,string) (at /Users/runner/work/firebase-unity-sdk/firebase-unity-sdk/app/src/LogUtil.cs:77)
Firebase.Auth.FirebaseUserInternal:LinkWithCredentialInternalAsync (Firebase.Auth.Credential) (at /Users/runner/work/firebase-unity-sdk/firebase-unity-sdk/macos_unity/x86_64/auth/swig/Firebase.Auth_fixed.cs:3387)
Firebase.Auth.FirebaseUser/<LinkWithCredentialAsync>d__11:MoveNext () (at /Users/runner/work/firebase-unity-sdk/firebase-unity-sdk/auth/src/FirebaseUser.cs:157)
System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<Firebase.Auth.AuthResult>:Start<Firebase.Auth.FirebaseUser/<LinkWithCredentialAsync>d__11> (Firebase.Auth.FirebaseUser/<LinkWithCredentialAsync>d__11&)
Firebase.Auth.FirebaseUser:LinkWithCredentialAsync (Firebase.Auth.Credential)
GameSceneManager/<ConvertUserWithEmail>d__92:MoveNext () (at Assets/GameSceneManager.cs:1881)
System.Runtime.CompilerServices.AsyncTaskMethodBuilder:Start<GameSceneManager/<ConvertUserWithEmail>d__92> (GameSceneManager/<ConvertUserWithEmail>d__92&)
GameSceneManager:ConvertUserWithEmail (string,string)
GameSceneManager:ChangeAnonymousToEmailLogin () (at Assets/GameSceneManager.cs:1669)
UnityEngine.EventSystems.EventSystem:Update () (at ./Library/PackageCache/com.unity.ugui@1.0.0/Runtime/EventSystem/EventSystem.cs:530)

Firebase.FirebaseException: This operation is not allowed. You must enable this service in the console.
  at Firebase.Auth.FirebaseUser.LinkWithCredentialAsync (Firebase.Auth.Credential credential) [0x00037] in /Users/runner/work/firebase-unity-sdk/firebase-unity-sdk/auth/src/FirebaseUser.cs:157 
  at GameSceneManager.ConvertUserWithEmail (System.String email, System.String password) [0x00046] in D:\Life\Life\Assets\GameSceneManager.cs:1881 
UnityEngine.Debug:Log (object)
GameSceneManager/<ConvertUserWithEmail>d__92:MoveNext () (at Assets/GameSceneManager.cs:1886)
System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<Firebase.Auth.AuthResult>:SetException (System.Exception)
Firebase.Auth.FirebaseUser/<LinkWithCredentialAsync>d__11:MoveNext () (at /Users/runner/work/firebase-unity-sdk/firebase-unity-sdk/auth/src/FirebaseUser.cs:159)
System.Threading.Tasks.TaskCompletionSource`1<Firebase.Auth.AuthResult>:SetException (System.Exception)
Firebase.Auth.Future_AuthResult/<>c__DisplayClass5_0:<GetTask>b__0 () (at /Users/runner/work/firebase-unity-sdk/firebase-unity-sdk/macos_unity/x86_64/auth/swig/Firebase.Auth_fixed.cs:1471)
Firebase.Auth.Future_AuthResult:SWIG_CompletionDispatcher (int) (at /Users/runner/work/firebase-unity-sdk/firebase-unity-sdk/macos_unity/x86_64/auth/swig/Firebase.Auth_fixed.cs:1561)
Firebase.AppUtil:PollCallbacks () (at /Users/runner/work/firebase-unity-sdk/firebase-unity-sdk/macos_unity/x86_64/app/swig/Firebase.App_fixed.cs:4812)
Firebase.Platform.FirebaseAppUtils:PollCallbacks () (at /Users/runner/work/firebase-unity-sdk/firebase-unity-sdk/app/platform/FirebaseAppUtils.cs:33)
Firebase.Platform.FirebaseHandler:Update () (at /Users/runner/work/firebase-unity-sdk/firebase-unity-sdk/app/platform/Unity/FirebaseHandler.cs:208)
Firebase.Platform.FirebaseMonoBehaviour:Update () (at /Users/runner/work/firebase-unity-sdk/firebase-unity-sdk/app/platform/Unity/FirebaseMonoBehaviour.cs:45)

image

image

test on device Exception
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.

@paulinon paulinon removed the new New issue. label Nov 7, 2023
@11101100 11101100 changed the title [Question] How to fix "The given sign-in provider is disabled for this Firebase project. Enable it in the Firebase console" I can't convert an anonymous account to a permanent account [Bug] How to fix "The given sign-in provider is disabled for this Firebase project. Enable it in the Firebase console" I can't convert an anonymous account to a permanent account Nov 7, 2023
@paulinon
Copy link
Contributor

paulinon commented Nov 8, 2023

Hi @11101100,

There is a known issue caused by the the Email Enumeration protection feature that is enabled by default on new projects, and a workaround for this is to disable this feature.

That said, I'll be marking this as a bug for now. You may refer to this thread for updates.

@ShaheenDevelopers
Copy link

I was also getting this error the given sign-in provider is disabled for this firebase project and I tried all possible methods but nothing works anything for me. Then I downgrade androidx.core:core-ktx:1.12.0 to androidx.core:core-ktx:1.9.0 and luckily error resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants