![](/img/trans.png)
[英]Firebase Google Authentication Says: Access blocked: This app’s request is invalid
[英]Sign-In with Google "Access blocked: This app's request is invalid"
我正在尝试通过 firebase 添加带有 next-auth.js 的用户身份验证。我遵循了有关如何使用 google 作为提供程序来实现登录系统的文档。 即使我输入了正确的凭据,谷歌仍然说该应用程序的请求无效。
这是我提出请求的方式:
import NextAuth from "next-auth";
import GoogleProvider from "next-auth/providers/google";
export const authOptions = {
// Configure one or more authentication providers
providers: [
GoogleProvider({
clientId: process.env.GOOGLE_CLIENT_ID,
clientSecret: process.env.GOOGLE_CLIENT_SECRET,
}),
// ...add more providers here
],
};
export default NextAuth(authOptions);
只需在您的 OAuth 2.0 客户端 ID 配置中提及授权重定向 URI(附图片):
下一个 auth 文档也 state 提到:授权重定向 URI
对于生产:https://{YOUR_DOMAIN}/api/auth/callback/google 对于开发:http://localhost:3000/api/auth/callback/google
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.