【问题标题】:Changing the domain shown by Google Account Chooser更改 Google 帐户选择器显示的域
【发布时间】:2017-11-28 12:54:33
【问题描述】:

在网络应用中,我们使用 Firebase 身份验证来管理登录和(基本)帐户创建。当用户使用谷歌登录选项时,用户使用多个谷歌账户,用户会看到谷歌账户选择器,以选择在我们的网站上使用哪个账户。它的标题看起来像这样:

选择一个帐户
以继续访问 mydomain.com

在我的网络应用程序中,它不是显示 mydomain.com,而是显示 .firebaseapp.com

我需要做些什么来改变帐户选择器弹出窗口显示 mydomain.com

【问题讨论】:

    标签: web-applications firebase-authentication angularfire2 google-oauth


    【解决方案1】:

    如果您想将其自定义为: 选择一个帐户继续:https://auth.example.com 您需要遵循以下说明:

    • 您需要将自定义域 auth.example.com 指向由 Firebase Hosting 托管的 example.firebaseapp.com。
    • 然后,您需要确保将 Firebase 控制台中的以下 URL 列为授权域(身份验证 -> 登录方法 -> 授权域):auth.example.com
    • 您需要将此页面列入白名单,作为所有支持的提供商(Google、Facebook、Twitter、LinkedIn)的 OAuth 重定向 URL:https://auth.example.com/__/auth/handler
    • 最后,您需要在 JS 客户端调用中将该域替换为您的 authDomain

      var config = { apiKey: "...", authDomain: "auth.example.com", ... };

    【讨论】:

    • 当您说“让您的自定义域 auth.example.com 指向 example.firebaseapp.com”时,这是否意味着临时重定向或一些 DNS A 记录?
    • DNS CNAME 记录。
    • 您不必在https://auth.example.com/__/auth/handler 实现任何东西。该页面由 Firebase Hosting 为每个项目配置,以促进 OAuth 握手并将结果安全传输到您的页面。
    猜你喜欢
    • 2014-01-07
    • 2013-10-11
    • 1970-01-01
    • 1970-01-01
    • 2017-11-09
    • 1970-01-01
    • 1970-01-01
    • 2018-12-09
    • 1970-01-01
    相关资源
    最近更新 更多