Package pro.taskana.common.rest
Class SpringSecurityToJaasFilter
java.lang.Object
org.springframework.web.filter.GenericFilterBean
pro.taskana.common.rest.SpringSecurityToJaasFilter
- 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 SpringSecurityToJaasFilter
extends org.springframework.web.filter.GenericFilterBean
Simple Filter to map all Spring Security Roles to JAAS-Principals.
-
Field Summary
Fields inherited from class org.springframework.web.filter.GenericFilterBean
logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddoFilter(jakarta.servlet.ServletRequest request, jakarta.servlet.ServletResponse response, jakarta.servlet.FilterChain chain) Obtains theSubjectto run as ornullif noSubjectis available.Methods inherited from class org.springframework.web.filter.GenericFilterBean
addRequiredProperty, afterPropertiesSet, createEnvironment, destroy, getEnvironment, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, initFilterBean, setBeanName, setEnvironment, setServletContext
-
Constructor Details
-
SpringSecurityToJaasFilter
public SpringSecurityToJaasFilter()
-
-
Method Details
-
doFilter
public void doFilter(jakarta.servlet.ServletRequest request, jakarta.servlet.ServletResponse response, jakarta.servlet.FilterChain chain) throws IOException, jakarta.servlet.ServletException - Throws:
IOExceptionjakarta.servlet.ServletException
-
obtainSubject
Obtains theSubjectto run as ornullif noSubjectis available.The default implementation attempts to obtain the
Subjectfrom theSecurityContext'sAuthentication. If it is of typeJaasAuthenticationTokenand is authenticated, theSubjectis returned from it.- Returns:
- the Subject to run.
-