![](/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.