-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Description
Expected Behavior
When we get errors from IDP (in our case its Okta), we should get a correctly formed OAuth2Error with the error code and description.
Current Behavior
The root cause error is lost, because the error conversion is not compliant with OKTA error response.
Okta error example:
{ "errorCode": "invalid_client", "errorSummary": "Invalid value for 'client_id' parameter.", "errorLink": "invalid_client", "errorId": "oaeUy44O3E3Q6mR4ZIcy50gKg", "errorCauses": [] }
The OAuth2ErrorConverter try to map mandatory parameter with name error however with Okta this attribute is named with errorCode
At the end, we lost the Okta error, and we get IllegalArgumentException raised by the constructor of OAuth2Error
A quick fix, could be allowing setter for OAuth2ErrorHttpMessageConverter in OAuth2ErrorResponseErrorHandler or add a constructor with OAuth2ErrorHttpMessageConverter .
Thanks