【发布时间】:2022-01-02 14:56:15
【问题描述】:
Firebase 身份验证在 localhost 中运行良好,但在生产中的 google cloud run 项目中失败,仅显示 403,没有详细说明错误原因
这是标题:
> POST /api/account/auth2/ HTTP/2 Host: appsite.com User-Agent: Mozilla/5.0
> (Macintosh; Intel Mac OS X 10.15; rv:95.0) Gecko/20100101 Firefox/95.0
> Accept: */* Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip,
> deflate, br Referer: https://appsite.com/ Content-Type:
> application/x-www-form-urlencoded; charset=UTF-8 X-CSRFToken:
> 6cpDY8qOBRK9XqfWcuLX6eujG85AmOnHp...b5f0j0t7tHy5rmAWCcEDw
> X-Requested-With: XMLHttpRequest Content-Length: 1251 Origin:
> https://appsite.com Connection: keep-alive Cookie:
> csrftoken=6cpDY8qOBRK9XqfWcuLX6eujG85AmOnHpi4IR9rRd...Hy5rmAWCcEDw
> Sec-Fetch-Dest: empty Sec-Fetch-Mode: cors Sec-Fetch-Site: same-origin
> TE: trailers
是的,我在 firebase auth 域中添加了域名。 这里的任何帮助都会很棒。
我正在使用 google gloud python google-auth=2.3.3
decoded_token = auth.verify_id_token(token)
uid = decoded_token["uid"]
还有我的 Javascript:const provider = new firebase.auth.GoogleAuthProvider();
$('.googleLogin').click(async function () {
const provider = new firebase.auth.GoogleAuthProvider();
// [START auth_google_provider_scopes]
const credential = await firebase.auth().signInWithPopup(provider);
const idToken = await firebase.auth().currentUser.getIdToken();
// Send Token to Back End
return handleMethod(idToken)
});
【问题讨论】:
标签: python-3.x firebase-authentication