Implementing custom OAuth with Next Auth?
Unanswered
Egyptian Mau posted this in #help-forum
![Avatar](https://cdn.discordapp.com/embed/avatars/5.png)
Egyptian MauOP
Hey, I need to implement an OAuth API that works the following way:
1: User logs in => I got that step covered I just put the authorization url in the provider to the URL of the API.
2: API redirects to a frontend url with a code that can be exchanged for a refresh and access token by calling another endpoint, lets call it apiurl.com/getToken?code=whatever => In part clear to me I need to receive that code on the frontend and hit that api. What is not clear to me is how I do this in my provider so that Next Auth understands what is happening?
1: User logs in => I got that step covered I just put the authorization url in the provider to the URL of the API.
2: API redirects to a frontend url with a code that can be exchanged for a refresh and access token by calling another endpoint, lets call it apiurl.com/getToken?code=whatever => In part clear to me I need to receive that code on the frontend and hit that api. What is not clear to me is how I do this in my provider so that Next Auth understands what is happening?