Next.js Discord

Discord Forum

Next-Auth Custom Provider / #oauth_callback_error client_secret_basic client

Unanswered
Highlander posted this in #help-forum
Open in Discord
HighlanderOP
next version: 13.4.19
node version: 18.12.1

I am on next-auth-example and there i added my code.
first there was error so delete the folder app/api/auth/[...nextauth]
becaus it kept giving duplicate route error thingi.
I am currently stuck in trying to authenticate a custom provider (I cant find anywhere active example for that)


provoider array object consists of this

 {
     id:"Umar",
      name: "umarPKCTNextAuth",
      type: "oauth",
 
      wellKnown:"https://auth.folderit.com/.well-known/openid-configuration",
      checks: ["pkce","state"],
      idToken: true,
      clientId: process.env.AUTH0_ID,
     
      authorization: { params: { scope: "openid" } },
      profile(profile: { id: any; kakao_account: { profile: { nickname: any; profile_image_url: any }; email: any } }) {
        return {
          id: profile.id,
          name: profile.kakao_account?.profile.nickname,
          email: profile.kakao_account?.email,
          image: profile.kakao_account?.profile.profile_image_url,
        }
      }
    },


env local is simply this
NEXTAUTH_URL=http://localhost:3002/

ofcourse i added clinet id in env AUTH0_ID

it does most of the steps for auth but in the end gives this error below

[next-auth][error][OAUTH_CALLBACK_ERROR] 
https://next-auth.js.org/errors#oauth_callback_error client_secret_basic client authentication method requires a client_secret


APi credentials are for OIDC PKCE flow. and ofcourse does not have Client secret at all

even if i change the callback url
uses this in payload
redirect_uri: http://localhost:3002/api/auth/callback/Umar



I am stuck on this for more then a day now and cant find a proper solution

1 Reply

HighlanderOP
anyone got any idea what might be the issue here ?