Replies: 4 comments
-
Please provide more details. What OAuth provider are you using, and why do you need the authorization code? The authorization code is typically a temporary, one-time code, which Passport uses internally. The code is exchanged for an access token, which Passport does provide. |
Beta Was this translation helpful? Give feedback.
-
Hello, @jaredhanson Is there more convenient way to get it? Keep up the good work! |
Beta Was this translation helpful? Give feedback.
-
Hello, @jaredhanson, are there any updates on this? |
Beta Was this translation helpful? Give feedback.
-
I think you are experiencing some confusion with how to utilize OAuth 2.0 correctly. The authorization code is a one-time use code used to obtain an access token and refresh token. The authorization code isn't stored, and you certainly don't need both the refresh token and authorization code simultaneously. The authorization code is handled by Passport, and the OAuth 2.0 strategy will provide the refresh token to your application in the verify callback. You can persist this refresh token and use it to obtain new access tokens when they expire, without needing the authorization code. |
Beta Was this translation helpful? Give feedback.
-
Hello,
I'm having a trouble getting the authorization code when authorize against oAuth2 API. I've looked into calback request but no luck.
Best Regards
Beta Was this translation helpful? Give feedback.
All reactions