Class SimpleUrlAuthenticationSuccessHandler
- java.lang.Object
- 
- org.springframework.security.web.authentication.AbstractAuthenticationTargetUrlRequestHandler
- 
- org.springframework.security.web.authentication.SimpleUrlAuthenticationSuccessHandler
 
 
- 
- All Implemented Interfaces:
- AuthenticationSuccessHandler
 - Direct Known Subclasses:
- SavedRequestAwareAuthenticationSuccessHandler
 
 public class SimpleUrlAuthenticationSuccessHandler extends AbstractAuthenticationTargetUrlRequestHandler implements AuthenticationSuccessHandler AuthenticationSuccessHandler which can be configured with a default URL which users should be sent to upon successful authentication.The logic used is that of the parent class.- Since:
- 3.0
 
- 
- 
Field Summary- 
Fields inherited from class org.springframework.security.web.authentication.AbstractAuthenticationTargetUrlRequestHandlerlogger
 
- 
 - 
Constructor SummaryConstructors Constructor Description SimpleUrlAuthenticationSuccessHandler()SimpleUrlAuthenticationSuccessHandler(java.lang.String defaultTargetUrl)Constructor which sets the defaultTargetUrl property of the base class.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidclearAuthenticationAttributes(javax.servlet.http.HttpServletRequest request)Removes temporary authentication-related data which may have been stored in the session during the authentication process.voidonAuthenticationSuccess(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Authentication authentication)Calls the parent classhandle()method to forward or redirect to the target URL, and then callsclearAuthenticationAttributes()to remove any leftover session data.- 
Methods inherited from class org.springframework.security.web.authentication.AbstractAuthenticationTargetUrlRequestHandlerdetermineTargetUrl, determineTargetUrl, getDefaultTargetUrl, getRedirectStrategy, getTargetUrlParameter, handle, isAlwaysUseDefaultTargetUrl, setAlwaysUseDefaultTargetUrl, setDefaultTargetUrl, setRedirectStrategy, setTargetUrlParameter, setUseReferer
 - 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface org.springframework.security.web.authentication.AuthenticationSuccessHandleronAuthenticationSuccess
 
- 
 
- 
- 
- 
Constructor Detail- 
SimpleUrlAuthenticationSuccessHandlerpublic SimpleUrlAuthenticationSuccessHandler() 
 - 
SimpleUrlAuthenticationSuccessHandlerpublic SimpleUrlAuthenticationSuccessHandler(java.lang.String defaultTargetUrl) Constructor which sets the defaultTargetUrl property of the base class.- Parameters:
- defaultTargetUrl- the URL to which the user should be redirected on successful authentication.
 
 
- 
 - 
Method Detail- 
onAuthenticationSuccesspublic void onAuthenticationSuccess(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Authentication authentication) throws java.io.IOException, javax.servlet.ServletExceptionCalls the parent classhandle()method to forward or redirect to the target URL, and then callsclearAuthenticationAttributes()to remove any leftover session data.- Specified by:
- onAuthenticationSuccessin interface- AuthenticationSuccessHandler
- Parameters:
- request- the request which caused the successful authentication
- response- the response
- authentication- the Authentication object which was created during the authentication process.
- Throws:
- java.io.IOException
- javax.servlet.ServletException
 
 - 
clearAuthenticationAttributesprotected final void clearAuthenticationAttributes(javax.servlet.http.HttpServletRequest request) Removes temporary authentication-related data which may have been stored in the session during the authentication process.
 
- 
 
-