[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.request
function 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.request
function configuredtoken.request
function never appearOperationProcessingError: "response" is not a conform Token Endpoint response
💻 Code Example
🔍 Actual Behavior
token.request
function is never calledtoken.url
OperationProcessingError: "response" is not a conform Token Endpoint response
🎯 Expected Behavior
token.request
function is configured, it should be called instead of using default token exchange logic🔧 Current Workaround
Currently can only use
token.conform
to handle response format conversion, but this requires the third-party API to accept standard OAuth2 parameter formats.📊 Environment
@auth/core@^0.37.2
15.0.3
20.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.request
function 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.request
configuration work properly.Beta Was this translation helpful? Give feedback.
All reactions