on 2019 Apr 26 2:42 PM
Hi,
Currently i am getting exception like "error": "unsupported_grant_type" while try to get Oauth access token. I need to customize that error response with error type like validation error.
I saw that oAuth2ExceptionRendererV2 has exceptionConverter but still i have error in below format { "error": "unsupported_grant_type", "error_description": "Unsupported grant type: passwor" }
I need to add type in error response like { "errors": [ { "message": "forgoodtest@gmail.com", "type": "DuplicateUidError" } ] }
There is any way to customize the Oauth2Exception? Please guide me on this
Request clarification before answering.
Hi, Currently i have using https://localhost:9002/authorizationserver/oauth/token for Oauth i thing its configured in platform. in my local web service extension i have exceptionConverterV2 and oAuth2ExceptionRendererV2 but while calling https://localhost:9002/v2/oauth/token URL i got error. Could you please clarify how to enable this url in my local extension.
Please correct me if i am wrong.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi . Thank you for your response i will check.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The json serialization that you are noticing comes from Spring framework (spring-security module). Please take a look at the class OAuth2Exception and the annotation OAuth2ExceptionJackson2Serializer that is responsible for serializing these exceptions.
You have to essentially create your own wrapper exception and custom serializer to create the JSON in the format you prefer. You can find an example here https://medium.com/@beladiyahardik7/spring-security-custom-oauth2exception-in-spring-b35a62af4d34
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
19 | |
14 | |
3 | |
2 | |
2 | |
2 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.