Class SessionUrlAuthenticationSuccessHandler

java.lang.Object
org.springframework.security.web.authentication.AbstractAuthenticationTargetUrlRequestHandler
org.springframework.security.web.authentication.SimpleUrlAuthenticationSuccessHandler
org.jenkinsci.plugins.cas.spring.security.SessionUrlAuthenticationSuccessHandler
All Implemented Interfaces:
org.springframework.security.web.authentication.AuthenticationSuccessHandler

public class SessionUrlAuthenticationSuccessHandler extends org.springframework.security.web.authentication.SimpleUrlAuthenticationSuccessHandler
AuthenticationSuccessHandler that behaves like SimpleUrlAuthenticationSuccessHandler, but also looks for a configurable session attribute holding the target URL to redirect to.
Author:
Fabien Crespel
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     

    Fields inherited from class org.springframework.security.web.authentication.AbstractAuthenticationTargetUrlRequestHandler

    logger
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor which sets the defaultTargetUrl property of the base class.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected String
    determineTargetUrl(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)
    Builds the target URL according to the logic defined in the main class Javadoc.
     
    void
    setTargetUrlSessionAttribute(String targetUrlSessionAttribute)
     

    Methods inherited from class org.springframework.security.web.authentication.SimpleUrlAuthenticationSuccessHandler

    clearAuthenticationAttributes, onAuthenticationSuccess

    Methods inherited from class org.springframework.security.web.authentication.AbstractAuthenticationTargetUrlRequestHandler

    determineTargetUrl, 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

    Methods inherited from interface org.springframework.security.web.authentication.AuthenticationSuccessHandler

    onAuthenticationSuccess
  • Field Details

    • DEFAULT_TARGET_URL_SESSION_ATTRIBUTE

      public static final String DEFAULT_TARGET_URL_SESSION_ATTRIBUTE
      See Also:
  • Constructor Details

    • SessionUrlAuthenticationSuccessHandler

      public SessionUrlAuthenticationSuccessHandler(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 Details

    • determineTargetUrl

      protected String determineTargetUrl(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)
      Builds the target URL according to the logic defined in the main class Javadoc.
      Overrides:
      determineTargetUrl in class org.springframework.security.web.authentication.AbstractAuthenticationTargetUrlRequestHandler
    • getTargetUrlSessionAttribute

      public String getTargetUrlSessionAttribute()
      Returns:
      the targetUrlSessionAttribute
    • setTargetUrlSessionAttribute

      public void setTargetUrlSessionAttribute(String targetUrlSessionAttribute)
      Parameters:
      targetUrlSessionAttribute - the targetUrlSessionAttribute to set