使用 Google OAuth 2.0 进行客户端身份验证不起作用

Using Google OAuth 2.0 for Client-side Authentication not working

本文关键字:客户端 身份验证 不起作用 Google OAuth 使用      更新时间:2023-09-26

我正在使用Google API作为我的日历。它最近几天运行良好,但现在它在我的浏览器控制台中显示一些错误

Failed to load resource: the server responded with a status of 404 ()
https://apis.google.com/_/scs/apps-static/_/js/k=oz.gapi.en.JpdoJPJ5hQs.O/m=client/rt=j/sv=1/d=1/ed=1/am=AQ/rs=AGLTcCMrDhGj8PwnRZ6lDn8FgkiuwDfUVw/t=zcms/cb=gapi.loaded_0

我确定我的代码没有变化。我的应用会发生什么情况?请帮帮我!

经过几个小时的研究,我意识到一切都client.js文件中。当我构建此应用程序时,而不是使用此代码 <script src="https://apis.google.com/js/client.js?onload=checkAuth"></script>直接从谷歌获取代码,我下载了它并保存在本地。问题是Google会自动更新此代码,因此我们也必须对其进行更新。

总结:

原因:源代码被谷歌更改

解决方案:在本地更新源代码或使用

<script src="https://apis.google.com/js/client.js?onload=checkAuth"></script>

PS:对不起,我的英语:D不好