我一直在做 Stephen grider 类(class),他创建了一个 google oauth 客户端 ID,其授权的 js 来源为 http://localhost:5000授权重定向 URI 为 http://localhost:5000/ * 并且谷歌接受它。但是,当我尝试相同的操作时,它会抛出重定向 URI 错误:无效重定向:无法包含通配符 (*)。我不确定如果没有这个,它还会引起问题。有什么方法可以解决这个问题。我输入了 http://localhost:5000/ 作为临时解决方案。请推荐。
最佳答案
无论您遵循什么类(class),都必须非常古老。我与 Google 一起开发了五年,当时不允许使用通配符重定向 uri。
Authorized redirect URIs For use with requests from a web server. This is the path in your application that users are redirected to after they have authenticated with Google. The path will be appended with the authorization code for access. Must have a protocol. Cannot contain URL fragments or relative paths. Cannot be a public IP address.
重定向 uri 必须是您希望用来处理授权的文件的路径。
关于oauth - Google Oauth 授权重定向 URI 无法接受 URL 最后的/*,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52890301/