Package com.erudika.para.server.security
Class RestAuthFilter
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
ConstructorsConstructorDescriptionDefault constructor.RestAuthFilter(boolean apiSecurityEnabled) Creates the filter and optionally disables request signing checks. -
Method Summary
Modifier and TypeMethodDescriptionvoiddoFilter(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, setServletContextMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.beans.factory.InitializingBean
afterPropertiesSet
-
Constructor Details
-
RestAuthFilter
public RestAuthFilter()Default constructor. -
RestAuthFilter
public RestAuthFilter(boolean apiSecurityEnabled) Creates the filter and optionally disables request signing checks.- 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:
doFilterin interfacejakarta.servlet.Filter- Parameters:
req- a requestres- a responsechain- filter chain- Throws:
IOException- exjakarta.servlet.ServletException- ex
-