I am using AuthenticationEntryPoint to handle the Authentication issues.To deliver the exception reason to the end-user.
response.sendError(responseCode, "errorReason")
I recently upgraded the spring boot from "2.2.11.RELEASE" to "2.4.4". Since then it is not working anymore. It is not providing the "errorReason" in the response received by the client now. Is there any change recently introduced in spring-boot which I am missing?
As of Spring Boot 2.3, the message is no longer included in the error response by default:
The error message and any binding errors are no longer included in the default error page by default. This reduces the risk of leaking information to a client.
server.error.include-messageandserver.error.include-binding-errorscan be used to control the inclusion of the message and binding errors respectively. Supported values arealways,on-param, andnever.
Setting server.error.include-message=always will restore Spring Boot 2.2's behavior.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With