Package org.fcrepo.auth.common
Class ContainerRolesPrincipalProvider
- java.lang.Object
-
- org.fcrepo.auth.common.ContainerRolesPrincipalProvider
-
- All Implemented Interfaces:
javax.servlet.Filter,PrincipalProvider
public class ContainerRolesPrincipalProvider extends Object
Adds principals based on roles that are configured within the container and through a PrincipalProvider bean in the project.- Author:
- Kevin S. Clarke
- See Also:
PrincipalProvider
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classContainerRolesPrincipalProvider.ContainerRolesPrincipal
-
Constructor Summary
Constructors Constructor Description ContainerRolesPrincipalProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddestroy()voiddoFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain)Set<Principal>getPrincipals(javax.servlet.http.HttpServletRequest request)Extract principals from the provided HttpServletRequest.voidinit(javax.servlet.FilterConfig filterConfig)voidsetRoleNames(Set<String> roleNames)Sets the role names which have been configured in the repo.xml file.
-
-
-
Constructor Detail
-
ContainerRolesPrincipalProvider
public ContainerRolesPrincipalProvider()
-
-
Method Detail
-
setRoleNames
public void setRoleNames(Set<String> roleNames)
Sets the role names which have been configured in the repo.xml file.- Parameters:
roleNames- The names of container roles that should be recognized as principals
-
getPrincipals
public Set<Principal> getPrincipals(javax.servlet.http.HttpServletRequest request)
Description copied from interface:PrincipalProviderExtract principals from the provided HttpServletRequest.If no principals can be extracted, implementations of this method should return the empty set rather than null.
- Parameters:
request- the request- Returns:
- a set of security principals
-
init
public void init(javax.servlet.FilterConfig filterConfig)
- Specified by:
initin interfacejavax.servlet.Filter
-
doFilter
public void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain) throws IOException, javax.servlet.ServletException- Specified by:
doFilterin interfacejavax.servlet.Filter- Throws:
IOExceptionjavax.servlet.ServletException
-
destroy
public void destroy()
- Specified by:
destroyin interfacejavax.servlet.Filter
-
-