Package com.pingidentity.adapter.support
Class LogoutHandler
- java.lang.Object
-
- com.pingidentity.adapter.support.LogoutHandler
-
- All Implemented Interfaces:
org.sourceid.websso.servlet.adapter.Handler
public class LogoutHandler extends Object implements org.sourceid.websso.servlet.adapter.Handler
The LogoutHandler allows the logout method of an IdP adapter to be invoked independently of the normal SSO/SLO flow of PF. Three different options of what to do after the logout are provided. If the redirectDestination is set, the user will be redirected to that location after logout. If the templateName is set, the PF engine will look for and attempt to render a template of that name in the pingfederate/server/default/conf/template/ directory. If neither redirectDestination nor templateName is set, the defaultContent is rendered directly into the response.
-
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_CONTENTThe default used if no explicit value is set for defaultContent
-
Constructor Summary
Constructors Constructor Description LogoutHandler(IdpAuthenticationAdapter adapter, String path)Creates and registers a new LogoutHandler
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetDefaultContent()Returns the default HTML content to render after logout if redirectDestination and templateName are not set.StringgetRedirectDestination()Returns the location that the user will be redirected to after the logout.StringgetTemplateName()Returns the name of the template to render after the logout.voidhandle(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)Implementation of the Handler interface called by the PF runtime.voidsetDefaultContent(String defaultContent)Sets the default HTML content to render after logout if redirectDestination and templateName are not set.voidsetRedirectDestination(String redirectDestination)Sets the location that the user will be redirected to after the logout.voidsetTemplateName(String templateName)Sets the name of the template to render after the logout.
-
-
-
Field Detail
-
DEFAULT_CONTENT
public static final String DEFAULT_CONTENT
The default used if no explicit value is set for defaultContent- See Also:
- Constant Field Values
-
-
Constructor Detail
-
LogoutHandler
public LogoutHandler(IdpAuthenticationAdapter adapter, String path)
Creates and registers a new LogoutHandler- Parameters:
adapter- the IdP adapter that will have its logout method calledpath- the sub path that the handler will be registered at. Must to start with a "/". The actual path will be [pf-home]/ext{path}
-
-
Method Detail
-
getRedirectDestination
public String getRedirectDestination()
Returns the location that the user will be redirected to after the logout.- Returns:
- The location that the user will be redirected to after the logout.
-
setRedirectDestination
public void setRedirectDestination(String redirectDestination)
Sets the location that the user will be redirected to after the logout.- Parameters:
redirectDestination- the URL or relative path that the user will be redirected to
-
getDefaultContent
public String getDefaultContent()
Returns the default HTML content to render after logout if redirectDestination and templateName are not set.- Returns:
- The default HTML content to render after logout if redirectDestination and templateName are not set.
-
setDefaultContent
public void setDefaultContent(String defaultContent)
Sets the default HTML content to render after logout if redirectDestination and templateName are not set.- Parameters:
defaultContent- HTML content
-
getTemplateName
public String getTemplateName()
Returns the name of the template to render after the logout.- Returns:
- The name of the template to render after the logout.
-
setTemplateName
public void setTemplateName(String templateName)
Sets the name of the template to render after the logout.- Parameters:
templateName- the name of the HTML template file
-
handle
public void handle(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws javax.servlet.ServletException, IOExceptionImplementation of the Handler interface called by the PF runtime.- Specified by:
handlein interfaceorg.sourceid.websso.servlet.adapter.Handler- Throws:
javax.servlet.ServletExceptionIOException
-
-