java.lang.Object
org.springframework.web.filter.GenericFilterBean
com.erudika.para.server.security.RestAuthFilter
- All Implemented Interfaces:
jakarta.servlet.Filter
,org.springframework.beans.factory.Aware
,org.springframework.beans.factory.BeanNameAware
,org.springframework.beans.factory.DisposableBean
,org.springframework.beans.factory.InitializingBean
,org.springframework.context.EnvironmentAware
,org.springframework.core.env.EnvironmentCapable
,org.springframework.web.context.ServletContextAware
public class RestAuthFilter
extends org.springframework.web.filter.GenericFilterBean
implements org.springframework.beans.factory.InitializingBean
Authenticates API access for
App
and User
objects.- Author:
- Alex Bogdanovski [[email protected]]
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
doFilter
(jakarta.servlet.ServletRequest req, jakarta.servlet.ServletResponse res, jakarta.servlet.FilterChain chain) Authenticates an application or user or guest.Methods inherited from class org.springframework.web.filter.GenericFilterBean
afterPropertiesSet, destroy, getEnvironment, getFilterConfig, init, setBeanName, setEnvironment, setServletContext
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.beans.factory.InitializingBean
afterPropertiesSet
-
Constructor Details
-
RestAuthFilter
public RestAuthFilter()Default constructor. -
RestAuthFilter
public RestAuthFilter(boolean apiSecurityEnabled) - Parameters:
apiSecurityEnabled
- true if API security is enabled
-
-
Method Details
-
doFilter
public void doFilter(jakarta.servlet.ServletRequest req, jakarta.servlet.ServletResponse res, jakarta.servlet.FilterChain chain) throws IOException, jakarta.servlet.ServletException Authenticates an application or user or guest.- Specified by:
doFilter
in interfacejakarta.servlet.Filter
- Parameters:
req
- a requestres
- a responsechain
- filter chain- Throws:
IOException
- exjakarta.servlet.ServletException
- ex
-