com.force.sdk.springsecurity
Class LogoutSuccessHandler

java.lang.Object
  extended by org.springframework.security.web.authentication.AbstractAuthenticationTargetUrlRequestHandler
      extended by org.springframework.security.web.authentication.logout.SimpleUrlLogoutSuccessHandler
          extended by com.force.sdk.springsecurity.LogoutSuccessHandler
All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean, org.springframework.security.web.authentication.logout.LogoutSuccessHandler

public class LogoutSuccessHandler
extends org.springframework.security.web.authentication.logout.SimpleUrlLogoutSuccessHandler
implements org.springframework.beans.factory.InitializingBean

Called after all logout handlers are processed. Redirects user to the configured logout URL. Can be configured to also log the user out of Force.com. Both options can be configured on the fss:oauth element. The logout URL comes from the default-logout-success attribute and the flag for logging out from Force.com comes from the logout-from-force-dot-com attribute. See @doclink force-security for more information.

Author:
Fiaz Hossain, John Simone

Field Summary
 
Fields inherited from class org.springframework.security.web.authentication.AbstractAuthenticationTargetUrlRequestHandler
DEFAULT_TARGET_PARAMETER, logger
 
Constructor Summary
LogoutSuccessHandler()
          Default constructor.
 
Method Summary
 void afterPropertiesSet()
           
protected  String determineTargetUrl(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
 void onLogoutSuccess(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.springframework.security.core.Authentication authentication)
          Clear the security context.
 void setLogoutFromForceDotCom(boolean logoutFromForceDotCom)
           
 void setOauthConnector(ForceOAuthConnector oauthConnector)
           
 void setSecurityContextService(SecurityContextService securityContextService)
           
 
Methods inherited from class org.springframework.security.web.authentication.AbstractAuthenticationTargetUrlRequestHandler
getDefaultTargetUrl, getRedirectStrategy, getTargetUrlParameter, handle, isAlwaysUseDefaultTargetUrl, setAlwaysUseDefaultTargetUrl, setDefaultTargetUrl, setRedirectStrategy, setTargetUrlParameter, setUseReferer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogoutSuccessHandler

public LogoutSuccessHandler()
Default constructor. No values defaulted. The oauthConnector and securityContextService must be set manually if not created in a Spring container.

Method Detail

setLogoutFromForceDotCom

public void setLogoutFromForceDotCom(boolean logoutFromForceDotCom)

setOauthConnector

public void setOauthConnector(ForceOAuthConnector oauthConnector)

setSecurityContextService

public void setSecurityContextService(SecurityContextService securityContextService)

afterPropertiesSet

public void afterPropertiesSet()
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean

determineTargetUrl

protected String determineTargetUrl(javax.servlet.http.HttpServletRequest request,
                                    javax.servlet.http.HttpServletResponse response)
Overrides:
determineTargetUrl in class org.springframework.security.web.authentication.AbstractAuthenticationTargetUrlRequestHandler

onLogoutSuccess

public void onLogoutSuccess(javax.servlet.http.HttpServletRequest request,
                            javax.servlet.http.HttpServletResponse response,
                            org.springframework.security.core.Authentication authentication)
                     throws IOException,
                            javax.servlet.ServletException
Clear the security context. This is necessary when cookie based storage is used.

Specified by:
onLogoutSuccess in interface org.springframework.security.web.authentication.logout.LogoutSuccessHandler
Overrides:
onLogoutSuccess in class org.springframework.security.web.authentication.logout.SimpleUrlLogoutSuccessHandler
Parameters:
request - HttpServletRequest
response - HttpServletResponse
authentication - Authentication
Throws:
IOException - only from call to super class
javax.servlet.ServletException - only from call to super class


Copyright © 2011. All Rights Reserved.