如何更改用于Firebase身份验证的应用程序名称(用户看到的内容) [英] How to change the app name for firebase authentication (what the user sees)

查看:147
本文介绍了如何更改用于Firebase身份验证的应用程序名称(用户看到的内容)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于使用了Firebase v 3.9.0,我的社交OAuth在我的离子应用程序中运行良好.我想做一点零钱.当提示您登录时,它说登录以继续到my-real-appname-12345f.firebaseapp.com."

Thanks to firebase v 3.9.0, my social OAuth is working great in my ionic app. I have one little change I'd like to make. When prompted to login, it says "Sign in to continue to my-real-appname-12345f.firebaseapp.com."

如何将其更改为更用户友好的名称,例如应用程序的实际名称.

How to I change that to something more user-friendly like, you know, the app's actually name.

为澄清起见,我正在使用Firebase处理Google和Facebook的身份验证.两者的消息是相同的.

To clarify, I am using firebase to handle authentication for both Google and Facebook. The message is the same for both.

谢谢! 韦恩

推荐答案

我向Firebase寻求支持,并得到以下答复. 斜体中的项目是我的补充.

I asked firebase support and got the following reply. Items in italics are my additions.

-

嗨Jayen,

感谢您与我们联系.我很乐意为您提供帮助.

Thank you for reaching out. I'll be happy to assist you.

为了在OAuth同意屏幕中更新firebase-project-id.firebaseapp.com,您需要一个具有Firebase托管的自定义域(Firebase控制台>托管>连接域).这是因为 https://firebase-project-id.firebaseapp.com/__/auth/handler 由Firebase Hosting托管.您需要将自定义域指向firebase-project-id.firebaseapp.com.

In order to update firebase-project-id.firebaseapp.com in the OAuth consent screen, you need a custom domain with Firebase Hosting (Firebase Console > Hosting > Connect Domain). This is because https://firebase-project-id.firebaseapp.com/__/auth/handler is hosted by Firebase Hosting. You need to point your custom domain to firebase-project-id.firebaseapp.com.

连接自定义域时,如果您不是将应用托管在Firebase上,请使用新的子域(例如app.yourdomain.com),并且不要重定向它. Firebase会提示您添加DNS条目并自动获取SSL证书.

将自定义域连接到Firebase项目后,您还应该按照以下步骤操作:

After connecting your custom domain to your Firebase project, you should also follow the steps below:

  1. 转到Firebase控制台>选择项目">身份验证">登录方法>"Facebook">在要完成设置,将此OAuth重定向URI添加到您的Facebook应用程序配置"下复制URL.

  1. Go to the Firebase Console > Select Project > Authentication > Sign-in method > Facebook > Copy the URL under 'To complete setup, add this OAuth redirect URI to your Facebook app configuration.'

将项目ID替换为您的自定义域.它将类似于: https://yourdomain.com/__/auth/handler

Replace the project ID with your custom domain. It will look something like: https://yourdomain.com/__/auth/handler

然后确保在应用的配置中使用yourdomain.com作为authDomain而不是firebase-project-id.firebaseapp.com

Then ensure to use yourdomain.com as the authDomain in your app's configuration instead of firebase-project-id.firebaseapp.com

firebase.initializeApp({
    apiKey: ....,
    authDomain: 'yourdomain.com',
     ...
});

如果您还有其他疑问,请告诉我.

Let me know if you have any other questions regarding this.

此致

-

在我的情况下,yourdomain.com是我托管网站的位置,因此我在需要的地方使用了app.yourdomain.com.

In my case, yourdomain.com is where I host my site, so I used app.yourdomain.com where I needed it.

  • Firebase托管URL
  • 处理程序网址: https://app.yourdomain.com/__/auth/handler
  • GCP凭据
    • OAuth 2.0客户端ID 下选择合适的一个.客户端ID将与您在代码中配置的Firebase匹配.
    • Firebase Hosting URL
    • handler url: https://app.yourdomain.com/__/auth/handler
    • GCP Credentials
      • Choose the right one under OAuth 2.0 client IDs . The client ID will match the one you have configured Firebase with in your code.

      这篇关于如何更改用于Firebase身份验证的应用程序名称(用户看到的内容)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆