Class JWTAuthorizationFilter

  • 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 JWTAuthorizationFilter
    extends org.springframework.security.web.authentication.www.BasicAuthenticationFilter
    Classe que implementa filtro de autorização
    Author:
    José Henrique
    • Field Summary

      • Fields inherited from class org.springframework.web.filter.OncePerRequestFilter

        ALREADY_FILTERED_SUFFIX
      • Fields inherited from class org.springframework.web.filter.GenericFilterBean

        logger
    • Constructor Summary

      Constructors 
      Constructor Description
      JWTAuthorizationFilter​(org.springframework.security.authentication.AuthenticationManager authenticationManager, JWTUtil jwtUtil, org.springframework.security.core.userdetails.UserDetailsService userDetailsService)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void doFilterInternal​(javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse, javax.servlet.FilterChain filterChain)
      Faz a autorização de acesso do usuário
      • Methods inherited from class org.springframework.security.web.authentication.www.BasicAuthenticationFilter

        afterPropertiesSet, getAuthenticationEntryPoint, getAuthenticationManager, getCredentialsCharset, isIgnoreFailure, onSuccessfulAuthentication, onUnsuccessfulAuthentication, setAuthenticationDetailsSource, setCredentialsCharset, setRememberMeServices
      • Methods inherited from class org.springframework.web.filter.OncePerRequestFilter

        doFilter, doFilterNestedErrorDispatch, getAlreadyFilteredAttributeName, isAsyncDispatch, isAsyncStarted, shouldNotFilter, shouldNotFilterAsyncDispatch, shouldNotFilterErrorDispatch
      • Methods inherited from class org.springframework.web.filter.GenericFilterBean

        addRequiredProperty, createEnvironment, destroy, getEnvironment, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, initFilterBean, setBeanName, setEnvironment, setServletContext
    • Constructor Detail

      • JWTAuthorizationFilter

        public JWTAuthorizationFilter​(org.springframework.security.authentication.AuthenticationManager authenticationManager,
                                      JWTUtil jwtUtil,
                                      org.springframework.security.core.userdetails.UserDetailsService userDetailsService)
    • Method Detail

      • doFilterInternal

        protected void doFilterInternal​(javax.servlet.http.HttpServletRequest httpServletRequest,
                                        javax.servlet.http.HttpServletResponse httpServletResponse,
                                        javax.servlet.FilterChain filterChain)
                                 throws IOException,
                                        javax.servlet.ServletException
        Faz a autorização de acesso do usuário
        Overrides:
        doFilterInternal in class org.springframework.security.web.authentication.www.BasicAuthenticationFilter
        Parameters:
        httpServletRequest - Requisição do usuário
        httpServletResponse - Resposta a ser enviada ao usuário
        filterChain - Objeto para chamar uma próxima função ca cadeia de filtros
        Throws:
        IOException
        javax.servlet.ServletException