Class AadAuthenticationFilter
- java.lang.Object
-
- org.springframework.web.filter.GenericFilterBean
-
- org.springframework.web.filter.OncePerRequestFilter
-
- com.azure.spring.cloud.autoconfigure.aad.filter.AadAuthenticationFilter
-
- 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 AadAuthenticationFilter extends org.springframework.web.filter.OncePerRequestFilterA stateful authentication filter which uses Microsoft Graph groups to authorize. Both ID token and access token are supported. In the case of access token, only access token issued for the exact same application this filter used for could be accepted, e.g. access token issued for Microsoft Graph could not be processed by users' application.- See Also:
OncePerRequestFilter
-
-
Constructor Summary
Constructors Constructor Description AadAuthenticationFilter(AadAuthenticationProperties aadAuthenticationProperties, AadAuthorizationServerEndpoints endpoints, UserPrincipalManager userPrincipalManager)Creates a new instance ofAadAuthenticationFilter.AadAuthenticationFilter(AadAuthenticationProperties aadAuthenticationProperties, AadAuthorizationServerEndpoints endpoints, com.nimbusds.jose.util.ResourceRetriever resourceRetriever)Creates a new instance ofAadAuthenticationFilter.AadAuthenticationFilter(AadAuthenticationProperties aadAuthenticationProperties, AadAuthorizationServerEndpoints endpoints, com.nimbusds.jose.util.ResourceRetriever resourceRetriever, com.nimbusds.jose.jwk.source.JWKSetCache jwkSetCache)Creates a new instance ofAadAuthenticationFilter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoFilterInternal(javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse, javax.servlet.FilterChain filterChain)Do filter.-
Methods inherited from class org.springframework.web.filter.OncePerRequestFilter
doFilter, doFilterNestedErrorDispatch, getAlreadyFilteredAttributeName, isAsyncDispatch, isAsyncStarted, shouldNotFilter, shouldNotFilterAsyncDispatch, shouldNotFilterErrorDispatch
-
-
-
-
Constructor Detail
-
AadAuthenticationFilter
public AadAuthenticationFilter(AadAuthenticationProperties aadAuthenticationProperties, AadAuthorizationServerEndpoints endpoints, com.nimbusds.jose.util.ResourceRetriever resourceRetriever)
Creates a new instance ofAadAuthenticationFilter.- Parameters:
aadAuthenticationProperties- the AAD authentication propertiesendpoints- the AAD authorization server endpointsresourceRetriever- the resource retriever
-
AadAuthenticationFilter
public AadAuthenticationFilter(AadAuthenticationProperties aadAuthenticationProperties, AadAuthorizationServerEndpoints endpoints, com.nimbusds.jose.util.ResourceRetriever resourceRetriever, com.nimbusds.jose.jwk.source.JWKSetCache jwkSetCache)
Creates a new instance ofAadAuthenticationFilter.- Parameters:
aadAuthenticationProperties- the AAD authentication propertiesendpoints- the AAD authorization server endpointsresourceRetriever- the resource retrieverjwkSetCache- the JWK set cache
-
AadAuthenticationFilter
public AadAuthenticationFilter(AadAuthenticationProperties aadAuthenticationProperties, AadAuthorizationServerEndpoints endpoints, UserPrincipalManager userPrincipalManager)
Creates a new instance ofAadAuthenticationFilter.- Parameters:
aadAuthenticationProperties- the AAD authentication propertiesendpoints- the AAD authorization server endpointsuserPrincipalManager- the user principal manager
-
-
Method Detail
-
doFilterInternal
protected void doFilterInternal(javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse, javax.servlet.FilterChain filterChain) throws javax.servlet.ServletException, IOExceptionDo filter.- Specified by:
doFilterInternalin classorg.springframework.web.filter.OncePerRequestFilter- Parameters:
httpServletRequest- the http servlet requesthttpServletResponse- the http servlet responcefilterChain- the filter chain- Throws:
javax.servlet.ServletExceptionIOException
-
-