@Component
public class AuthenticationErrorHandler
extends org.springframework.web.client.DefaultResponseErrorHandler
| Constructor and Description |
|---|
AuthenticationErrorHandler() |
| Modifier and Type | Method and Description |
|---|---|
protected String |
getErrorDescriptionFromBody(String body) |
protected String |
getResponseBody(org.springframework.http.client.ClientHttpResponse response) |
void |
handleError(org.springframework.http.client.ClientHttpResponse response)
The error handler intercepts the default error handler and checks if the returned HTTP status code is 400 Bad Request.
|
public void handleError(org.springframework.http.client.ClientHttpResponse response)
throws org.springframework.security.authentication.BadCredentialsException,
IOException
The error handler intercepts the default error handler and checks if the returned HTTP status code is 400 Bad Request. This status code particularly indicates that the authentication failure was not caused by the client or services, but was caused by invalid credentials or other account-related issues (e.g. account disabled).
The method attempts to read the error description from the response body.
handleError in interface org.springframework.web.client.ResponseErrorHandlerhandleError in class org.springframework.web.client.DefaultResponseErrorHandlerresponse - the responseorg.springframework.security.authentication.BadCredentialsException - if the HTTP status code was 400 Bad RequestIOException - in case of I/O errorsprotected String getResponseBody(org.springframework.http.client.ClientHttpResponse response)
Copyright © 2015–2016 Smartrac Technology Fletcher, Inc.. All rights reserved.