Skip to content

TokenAuthenticationFilter not injected correctly #86

Description

@KamBha

I am not sure what TokenAuthenticationFilter is for, but something I noticed in WebSecurityConfiguration is you do the following:-

    @Bean
    public TokenAuthenticationFilter tokenAuthenticationFilter() {
        return new TokenAuthenticationFilter();
    }

This seems odd to me as this class has autowired elements attached to it that are not actually autowired in.

Looking at the code, the only reason why this is not causing failures is because there is no JWT token being passed in:-

            String jwt = getJwtFromRequest(request);

            if (StringUtils.hasText(jwt) && tokenProvider.validateToken(jwt))

Is this in fact dead code?

Looking at the front end code, I do not see any actual bearertoken being passed down, so I suspect that this is dead code.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions