Issues with creating a custom provider #1371
Replies: 2 comments 1 reply
-
make sure the file is called The url you are seeing is the one the provider will send the response to, to execute the signin flow. Check out https://auth0.com/docs/flows/authorization-code-flow for more info. (number 5 and 6 on the picture is what I'm talking about here) This is usually referred to as return or callback url, and you have to add this url somewhere in your provider, where you set up the client for your app. https://next-auth.js.org/getting-started/rest-api#get-apiauthcallbackprovider Adding a |
Beta Was this translation helpful? Give feedback.
-
OK I verified that the file is named [...nextauth].js, and it is. But the callback URL is still not implemented by NextAuth.
I've logged the provider object when the callbackUrl is added here, and it is getting parsed correctly as it looks like this:
When you say "This is usually referred to as return or callback url, and you have to add this url somewhere in your provider, where you set up the client for your app." where exactly is that configured? |
Beta Was this translation helpful? Give feedback.
-
I'm struggling to create a custom provider, mostly around the redirect_uri.
I'm creating a custom provider, and the page that the auth check is performed at is at:
http://localhost:3000/auth/signin
After running the signIn() function from there, the page gets redirected to the login portal, but the redirect_uri is set to:
http://localhost:3000/api/auth/callback/identity-service
So a few questions here are: why is the redirect_uri being automatically set to this? I can't find a way to override it with anything other than that, and specifying a callbackUrl in the signIn() function doesn't change anything. What is the correct flow here? Do I need to implement a GET call at the redirect-uri that does what exactly?
I should note here that my [nextauth].js file lives in /api/auth/[nextauth].js
So nothing is implemented at /api/auth/callback/identity-service
Below is the provider config.
Beta Was this translation helpful? Give feedback.
All reactions