NextAuth Multiple OAuth2 Providers
Unanswered
Mucuchies posted this in #help-forum
MucuchiesOP
I've been trying to implement authentication using nextauth for multiple OAuth2 providers like Google, Onedrive, and Dropbox, and I want to know the best way I should go about it. I will need the tokens from each provider so that I can access their apis.
2 Replies
@Mucuchies I've been trying to implement authentication using nextauth for multiple OAuth2 providers like Google, Onedrive, and Dropbox, and I want to know the best way I should go about it. I will need the tokens from each provider so that I can access their apis.
you can add multiple provider to your next-auth config with the specific configurations. Then, inside your token & session callback, you create a key inside your token & session object, that's named "authToken" o r "token" or "accessToken" or whatever you feel good. There you can set the specific token from the provider
@Mucuchies solved?