OAuth2 Provider Callbacks Do Not Preserve Custom Query Parameters #11585
Unanswered
aryanjangid
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When using an OAuth2 provider (e.g., Google) with NextAuth.js, custom query parameters in the callbackUrl are not preserved after the authentication process. This issue does not occur when using the Credentials provider.
Steps to Reproduce:
Expected Behavior:
After the authentication process, the user should be redirected to the callbackUrl with the custom query parameters preserved, e.g.,
http://localhost:3000/authorize?org_id=123&redirect_uri=http://localhost:3001/
.Actual Behavior:
The user is redirected to the callbackUrl, but the custom query parameters are removed, e.g.,
http://localhost:3000/authorize
.Additional Context:
This issue seems to be a limitation of the OAuth2 protocol, as it does not preserve the query parameters in the redirect_uri after the authentication process. However, it would be helpful if NextAuth.js provided a way to preserve custom query parameters between the authentication request and the callback.
Beta Was this translation helpful? Give feedback.
All reactions