|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler
public class SimpleUrlAuthenticationFailureHandler
AuthenticationFailureHandler which performs a redirect to the value of the defaultFailureUrl
property when the onAuthenticationFailure method is called.
If the property has not been set it will send a 401 response to the client, with the error message from the
AuthenticationException which caused the failure.
If the forwardToDestination parameter is set, a RequestDispatcher.forward call will be made to the destination instead of a redirect.
Field Summary | |
---|---|
protected org.apache.commons.logging.Log |
logger
|
Constructor Summary | |
---|---|
SimpleUrlAuthenticationFailureHandler()
|
|
SimpleUrlAuthenticationFailureHandler(String defaultFailureUrl)
|
Method Summary | |
---|---|
protected RedirectStrategy |
getRedirectStrategy()
|
protected boolean |
isUseForward()
|
void |
onAuthenticationFailure(HttpServletRequest request,
HttpServletResponse response,
AuthenticationException exception)
Called when an authentication attempt fails. |
void |
setDefaultFailureUrl(String defaultFailureUrl)
The URL which will be used as the failure destination. |
void |
setRedirectStrategy(RedirectStrategy redirectStrategy)
Allows overriding of the behaviour when redirecting to a target URL. |
void |
setUseForward(boolean forwardToDestination)
If set to true, performs a forward to the failure destination URL instead of a redirect. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final org.apache.commons.logging.Log logger
Constructor Detail |
---|
public SimpleUrlAuthenticationFailureHandler()
public SimpleUrlAuthenticationFailureHandler(String defaultFailureUrl)
Method Detail |
---|
public void onAuthenticationFailure(HttpServletRequest request, HttpServletResponse response, AuthenticationException exception) throws IOException, ServletException
AuthenticationFailureHandler
onAuthenticationFailure
in interface AuthenticationFailureHandler
request
- the request during which the authentication attempt occurred.response
- the response.exception
- the exception which was thrown to reject the authentication request.
IOException
ServletException
public void setDefaultFailureUrl(String defaultFailureUrl)
defaultFailureUrl
- the failure URL, for example "/loginFailed.jsp".protected boolean isUseForward()
public void setUseForward(boolean forwardToDestination)
public void setRedirectStrategy(RedirectStrategy redirectStrategy)
protected RedirectStrategy getRedirectStrategy()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |