作者:一支妙笔生花来 | 来源:互联网 | 2022-12-10 14:21
如何解决《Firebasesays"Domainnotwhitelisted"foralinkthatiswhitelisted》经验,为你挑选了1个好方法。
I am busy setting up a firebase authentication using an email magic link and using the guide here:
https://firebase.google.com/docs/auth/android/email-link-auth
It says I need to whitelist a domain, but I cannot find any place in the console to do that, other than the dynamic link I created. I tried running the below code, but I get
[ UNAUTHORIZED_DOMAIN:Domain not whitelisted by project ]
val actiOnCodeSettings= ActionCodeSettings.newBuilder()
// URL you want to redirect back to. The domain (www.example.com) for this
// URL must be whitelisted in the Firebase Console.
.setUrl("https://myapphere.page.link/register") //I created this dynamic link in the firebase console
.setHandleCodeInApp(true)
.setAndroidPackageName(
"com.myapphere",
true,
"1")
.build()
val auth = FirebaseAuth.getInstance()
auth.sendSignInLinkToEmail(email, actionCodeSettings)
.addOnCompleteListener(this) { task ->
if (task.isSuccessful) {
// Sign in success, update UI with the signed-in user's information
} else {
// If sign in fails, display a message to the user.
}
}
Am I not supposed to use dynamic links for firebase authentication? And if so, where in the console do I whitelist domains, because I cannot find it.
1> Jacques.S..:
我想到了。如果您位于“身份验证”页面上的Firebase控制台上,则可以向下滚动,并且需要在此处将动态链接添加为列入白名单的域。
我曾在该页面上浏览过数十次,但从未见过可以向下滚动的指示。希望这对某人有帮助。