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 final String
    The default used if no explicit value is set for defaultContent
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates and registers a new LogoutHandler
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the default HTML content to render after logout if redirectDestination and templateName are not set.
    Returns the location that the user will be redirected to after the logout.
    Returns the name of the template to render after the logout.
    void
    handle(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
    Implementation of the Handler interface called by the PF runtime.
    void
    setDefaultContent(String defaultContent)
    Sets the default HTML content to render after logout if redirectDestination and templateName are not set.
    void
    setRedirectDestination(String redirectDestination)
    Sets the location that the user will be redirected to after the logout.
    void
    setTemplateName(String templateName)
    Sets the name of the template to render after the logout.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • DEFAULT_CONTENT

      public static final String DEFAULT_CONTENT
      The default used if no explicit value is set for defaultContent
      See Also:
  • Constructor Details

    • LogoutHandler

      public LogoutHandler(IdpAuthenticationAdapter adapter, String path)
      Creates and registers a new LogoutHandler
      Parameters:
      adapter - the IdP adapter that will have its logout method called
      path - 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 Details

    • 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, IOException
      Implementation of the Handler interface called by the PF runtime.
      Specified by:
      handle in interface org.sourceid.websso.servlet.adapter.Handler
      Throws:
      javax.servlet.ServletException
      IOException