Package org.pac4j.springframework.web
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 Summary
ConstructorsConstructorDescriptionEmpty constructor.SecurityInterceptor(org.pac4j.core.config.Config config) Constructor.SecurityInterceptor(org.pac4j.core.config.Config config, String clients) Constructor.SecurityInterceptor(org.pac4j.core.config.Config config, String clients, String authorizers) Constructor.SecurityInterceptor(org.pac4j.core.config.Config config, String clients, String authorizers, String matchers) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic SecurityInterceptorAdvanced builder.Get the authorizers.Get the clients.org.pac4j.core.config.ConfigGet the security config.org.pac4j.core.http.adapter.HttpActionAdapterGet the specific HTTP action adapter.Get the matchers.org.pac4j.core.engine.SecurityLogicGet the specific security logic.booleanpreHandle(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, Object handler) voidsetAuthorizers(String authorizers) Set the authorizers.voidsetClients(String clients) Set the clients.voidsetConfig(org.pac4j.core.config.Config config) Define the security config.voidsetHttpActionAdapter(org.pac4j.core.http.adapter.HttpActionAdapter httpActionAdapter) Define the specific HTTP action adapter.voidsetMatchers(String matchers) Set the matchers.voidsetSecurityLogic(org.pac4j.core.engine.SecurityLogic securityLogic) Define the specific security logic.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.web.servlet.HandlerInterceptor
afterCompletion, postHandle
-
Constructor Details
-
SecurityInterceptor
public SecurityInterceptor()Empty constructor. -
SecurityInterceptor
public SecurityInterceptor(org.pac4j.core.config.Config config) Constructor.- Parameters:
config- the config
-
SecurityInterceptor
Constructor.- Parameters:
config- the configclients- the clients
-
SecurityInterceptor
Constructor.- Parameters:
config- the configclients- the clientsauthorizers- the authorizers
-
SecurityInterceptor
public SecurityInterceptor(org.pac4j.core.config.Config config, String clients, String authorizers, String matchers) Constructor.- Parameters:
config- the configclients- the clientsauthorizers- the authorizersmatchers- the matchers
-
-
Method Details
-
build
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:
preHandlein interfaceorg.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:
setSecurityLogicin interfaceorg.pac4j.core.util.security.SecurityEndpoint- Parameters:
securityLogic- the security logic
-
getClients
Get the clients.- Returns:
- the clients
-
setClients
Set the clients.- Specified by:
setClientsin interfaceorg.pac4j.core.util.security.SecurityEndpoint- Parameters:
clients- the clients
-
getAuthorizers
Get the authorizers.- Returns:
- the authorizers
-
setAuthorizers
Set the authorizers.- Specified by:
setAuthorizersin interfaceorg.pac4j.core.util.security.SecurityEndpoint- Parameters:
authorizers- the authorizers
-
getMatchers
Get the matchers.- Returns:
- the matchers
-
setMatchers
Set the matchers.- Specified by:
setMatchersin interfaceorg.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:
setConfigin interfaceorg.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:
setHttpActionAdapterin interfaceorg.pac4j.core.util.security.SecurityEndpoint- Parameters:
httpActionAdapter- the specific HTTP action adapter
-