最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

next.js - Does nextauth set code_verifier cookie by default?* - Stack Overflow

programmeradmin3浏览0评论
  • Have setup authentik with below config
({
      id: "authentik",
      name: "Authentik",
      type: "oauth",
      version: "2.0",
      clientId: process.env.AUTHENTIK_CLIENT_ID,
      clientSecret: process.env.AUTHENTIK_CLIENT_SECRET,
      authorization: {
        url: process.env.AUTHENTIK_AUTH_URL,
        params: {
          redirect_uri: process.env.AUTHENTIK_REDIRECT_URI,
          scope: "openid profile email",          
        },
      },
      tokenUrl: process.env.AUTHENTIK_TOKEN_URL,
      userinfo: {
        url: process.env.AUTHENTIK_USER_INFO_URL,
      },
      profile(profile: User) {
        return {
          id: profile.id,
          name: profile.name,
          email: profile.email,
          team: profile.team,
        };
      },
    }) as OAuthConfig<User>
  • user is redirected to the authentik login page

  • on logging in, following error comes up:

error: [Error [OAuthCallbackError]: token_endpoint must be configured on the issuer] {
code: undefined
},
providerId: 'authentik',
message: 'token_endpoint must be configured on the issuer'
}

On digging in, I figured, code_verifier is not being set in the cookie. Is it something that nextjs does by default? or do we need to write the logic to set this code.

发布评论

评论列表(0)

  1. 暂无评论