Class SecurityInterceptor

java.lang.Object
org.pac4j.springframework.web.SecurityInterceptor
All Implemented Interfaces:
org.pac4j.core.util.security.SecurityEndpoint, org.springframework.web.servlet.HandlerInterceptor

public class SecurityInterceptor extends Object implements org.springframework.web.servlet.HandlerInterceptor, org.pac4j.core.util.security.SecurityEndpoint

This interceptor protects an URL.

Since:
1.0.0
Author:
Jerome Leleu
  • Constructor Details

    • SecurityInterceptor

      public SecurityInterceptor()
      Empty constructor.
    • SecurityInterceptor

      public SecurityInterceptor(org.pac4j.core.config.Config config)
      Constructor.
      Parameters:
      config - the config
    • SecurityInterceptor

      public SecurityInterceptor(org.pac4j.core.config.Config config, String clients)
      Constructor.
      Parameters:
      config - the config
      clients - the clients
    • SecurityInterceptor

      public SecurityInterceptor(org.pac4j.core.config.Config config, String clients, String authorizers)
      Constructor.
      Parameters:
      config - the config
      clients - the clients
      authorizers - the authorizers
    • SecurityInterceptor

      public SecurityInterceptor(org.pac4j.core.config.Config config, String clients, String authorizers, String matchers)
      Constructor.
      Parameters:
      config - the config
      clients - the clients
      authorizers - the authorizers
      matchers - the matchers
  • Method Details

    • build

      public static SecurityInterceptor build(Object... parameters)
      Advanced builder.
      Parameters:
      parameters - the parameters
      Returns:
      the defined security interceptor
    • preHandle

      public boolean preHandle(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, Object handler)
      Specified by:
      preHandle in interface org.springframework.web.servlet.HandlerInterceptor
    • getSecurityLogic

      public org.pac4j.core.engine.SecurityLogic getSecurityLogic()
      Get the specific security logic.
      Returns:
      the security logic
    • setSecurityLogic

      public void setSecurityLogic(org.pac4j.core.engine.SecurityLogic securityLogic)
      Define the specific security logic.
      Specified by:
      setSecurityLogic in interface org.pac4j.core.util.security.SecurityEndpoint
      Parameters:
      securityLogic - the security logic
    • getClients

      public String getClients()
      Get the clients.
      Returns:
      the clients
    • setClients

      public void setClients(String clients)
      Set the clients.
      Specified by:
      setClients in interface org.pac4j.core.util.security.SecurityEndpoint
      Parameters:
      clients - the clients
    • getAuthorizers

      public String getAuthorizers()
      Get the authorizers.
      Returns:
      the authorizers
    • setAuthorizers

      public void setAuthorizers(String authorizers)
      Set the authorizers.
      Specified by:
      setAuthorizers in interface org.pac4j.core.util.security.SecurityEndpoint
      Parameters:
      authorizers - the authorizers
    • getMatchers

      public String getMatchers()
      Get the matchers.
      Returns:
      the matchers
    • setMatchers

      public void setMatchers(String matchers)
      Set the matchers.
      Specified by:
      setMatchers in interface org.pac4j.core.util.security.SecurityEndpoint
      Parameters:
      matchers - the matchers
    • getConfig

      public org.pac4j.core.config.Config getConfig()
      Get the security config.
      Returns:
      the config
    • setConfig

      public void setConfig(org.pac4j.core.config.Config config)
      Define the security config.
      Specified by:
      setConfig in interface org.pac4j.core.util.security.SecurityEndpoint
      Parameters:
      config - the config
    • getHttpActionAdapter

      public org.pac4j.core.http.adapter.HttpActionAdapter getHttpActionAdapter()
      Get the specific HTTP action adapter.
      Returns:
      the specific HTTP action adapter
    • setHttpActionAdapter

      public void setHttpActionAdapter(org.pac4j.core.http.adapter.HttpActionAdapter httpActionAdapter)
      Define the specific HTTP action adapter.
      Specified by:
      setHttpActionAdapter in interface org.pac4j.core.util.security.SecurityEndpoint
      Parameters:
      httpActionAdapter - the specific HTTP action adapter