相关疑难解决方法(0)

Firebase身份验证-自定义的重定向域会提示NET :: ERR_CERT_COMMON_NAME_INVALID警告

我正在为我的Web应用程序使用Firebase身份验证,并为Firebase身份验证的Google登录功能自定义重定向域,以便Google的身份验证页面将

显示继续至:https://auth.mydomain.com

而不是继续:https://my-app-12345.firebaseapp.com

因此,我按照Firebase文档说明执行了四个步骤:

(1)为此创建一个CNAME记录auth.mydomain.com,指向my-app-12345.firebaseapp.com

(2)auth.mydomain.com在Firebase控制台中添加到授权域列表

(3)在Google OAuth设置页面中,将重定向页面的URL列入白名单。 https://auth.mydomain.com/__/auth/handler

(4)编辑我的应用程序的JavaScript代码以初始化Firebase库:

var config = {
  ...
  // from 'authDomain: my-app-12345.firebaseapp.com,'
  authDomain: 'auth.mydomain.com',
  ...
};
Run Code Online (Sandbox Code Playgroud)

但是,此后,当我的应用调用firebase.auth().signInWithRedirect(provider)方法时,网络浏览器将显示隐私警告,如下所示:

你的连接不是私人的

攻击者可能试图从auth.mydomain.com窃取您的信息(例如,密码,消息或信用卡)。学到更多

NET :: ERR_CERT_COMMON_NAME_INVALID

...

该服务器无法证明它是auth.mydomain.com ; 它的安全证书来自firebaseapp.com。这可能是由于配置错误或攻击者拦截了您的连接引起的。

继续访问auth.mydomain.com(不安全)

证书信息如下:

firebaseapp.com

颁发者:Google Internet Authority G3

过期:2018年11月13日,星期二

该证书有效。

细节

主题名称

国家:美国

州/省:加利福尼亚

产地:山景

机构:Google Inc

通用名称:firebaseapp.com

下面是URI:

https://auth.mydomain.com/__/auth/handler?apiKey=apiKey&appName=%5BDEFAULT%5D&authType=signInViaRedirect&providerId=google.com&scopes=profile&redirectUrl=https%3A%2F%2Fwww.mydomain.com%2Flogin&v=5.0.4
Run Code Online (Sandbox Code Playgroud)

为什么要为Google登录提示NET::ERR_CERT_COMMON_NAME_INVALID警告自定义重定向域,以及如何避免警告消息的提示,例如使用auth.mydomain.com自己的证书在证书中添加使用者替代名称? …

firebase firebase-authentication

3
推荐指数
2
解决办法
1289
查看次数

标签 统计

firebase ×1

firebase-authentication ×1