Class 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.OncePerRequestFilter
    A 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 Detail

      • AadAuthenticationFilter

        public AadAuthenticationFilter​(AadAuthenticationProperties aadAuthenticationProperties,
                                       AadAuthorizationServerEndpoints endpoints,
                                       com.nimbusds.jose.util.ResourceRetriever resourceRetriever)
        Creates a new instance of AadAuthenticationFilter.
        Parameters:
        aadAuthenticationProperties - the AAD authentication properties
        endpoints - the AAD authorization server endpoints
        resourceRetriever - 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 of AadAuthenticationFilter.
        Parameters:
        aadAuthenticationProperties - the AAD authentication properties
        endpoints - the AAD authorization server endpoints
        resourceRetriever - the resource retriever
        jwkSetCache - the JWK set cache
    • Method Detail

      • doFilterInternal

        protected void doFilterInternal​(javax.servlet.http.HttpServletRequest httpServletRequest,
                                        javax.servlet.http.HttpServletResponse httpServletResponse,
                                        javax.servlet.FilterChain filterChain)
                                 throws javax.servlet.ServletException,
                                        IOException
        Do filter.
        Specified by:
        doFilterInternal in class org.springframework.web.filter.OncePerRequestFilter
        Parameters:
        httpServletRequest - the http servlet request
        httpServletResponse - the http servlet responce
        filterChain - the filter chain
        Throws:
        javax.servlet.ServletException
        IOException