繁体   English   中英

使用 Google Firebase 身份验证,无需第三方 Cookies

[英]Use Google Firebase Authentication without 3rd Party Cookies

我目前正在尝试使用社交媒体登录,并意识到这些登录的传递方式有些奇怪,这是因为我的工作场所和大多数办公室一样,将第 3 方 cookies 作为安全策略。

Google Firebase Authentication uses 3rd party cookies and so if I try to use Firebase, I'm redirected to the Google page (as expected) but when I'm redirected back to the originating webpage after logging in (and Firebase tries to set cookies) ,我收到一条错误消息, This browser is not supported or 3rd party cookies and data may be disabled.

但是, MongoDB Stitch以某种方式工作并且我能够实际登录,即使禁用了第 3 方 cookies。 我真的无法理解为什么会这样,但我希望这里有人能对此有所了解。 If it helps, MongoDB Stitch asks that you set https://stitch.mongodb.com as Origin URI and https://stitch.mongodb.com/api/client/v2.0/auth/callback as Authorised Redirect URI in the Google 控制台 - 虽然您必须在 MongoDB 控制台中设置您自己的网站 URI,但我认为这可能有所不同?

无论如何,MongoDB Stitch 的文档严重不足(由于它仍处于公共测试版中)所以我真的很想 go 谷歌 Z035489FF8D092741943E4A83241F5AFZ 如果可能的话。

  1. 有谁知道 MongoDB Stitch 如何绕过设置第 3 方 Cookies
  2. 如何在禁用第三方 Cookies 的情况下使用 Google Firebase 身份验证

您是否尝试过使用gapi.auth2 ,即 Javascript 的​​Google 登录库 上次我检查时,它在禁用第三方 cookies 的情况下工作。 您可以使用它来获取 Google ID 令牌或访问令牌,然后登录 Firebase:

firebase.auth().signInWithCredential(firebase.auth.GoogleAuthProvider.credential(googleIdToken, googleAccessToken))...`

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM