[Bug]V5 OAuth Provider token.request configuration not working, defaults to token.url direct request #13256
Unanswered
leonwangcn
asked this question in
Help
Replies: 1 comment
-
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
🐛 Bug Description
When customizing an OAuth Provider with a
token.requestfunction to handle special token exchange logic, the function is never called. Auth.js defaults to making a direct request usingtoken.url, causing third-party OAuth services to return errors.📋 Steps to Reproduce
token.requestfunction configuredtoken.requestfunction never appearOperationProcessingError: "response" is not a conform Token Endpoint response💻 Code Example
🔍 Actual Behavior
token.requestfunction is never calledtoken.urlOperationProcessingError: "response" is not a conform Token Endpoint response🎯 Expected Behavior
token.requestfunction is configured, it should be called instead of using default token exchange logic🔧 Current Workaround
Currently can only use
token.conformto handle response format conversion, but this requires the third-party API to accept standard OAuth2 parameter formats.📊 Environment
@auth/core@^0.37.215.0.320.x🔗 Related Files
💡 Additional Context
This issue particularly affects OAuth providers that don't follow standard OAuth2 parameter naming conventions (like DingTalk, which uses camelCase instead of snake_case). The
token.requestfunction should provide a way to completely override the token exchange process, but it appears to be ignored in the current implementation.Hope this issue can be fixed to make
token.requestconfiguration work properly.Beta Was this translation helpful? Give feedback.
All reactions