Package pro.taskana.common.rest
Class SpringSecurityToJaasFilter
- java.lang.Object
-
- org.springframework.web.filter.GenericFilterBean
-
- pro.taskana.common.rest.SpringSecurityToJaasFilter
-
- All Implemented Interfaces:
javax.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.GenericFilterBeanSimple Filter to map all Spring Security Roles to JAAS-Principals.
-
-
Constructor Summary
Constructors Constructor Description SpringSecurityToJaasFilter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddoFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain)protected Optional<Subject>obtainSubject()Obtains theSubjectto run as ornullif noSubjectis available.
-
-
-
Method Detail
-
doFilter
public void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain) throws IOException, javax.servlet.ServletException- Throws:
IOExceptionjavax.servlet.ServletException
-
obtainSubject
protected Optional<Subject> 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.
-
-