polymer-spring-boot icon indicating copy to clipboard operation
polymer-spring-boot copied to clipboard

Shouldnt the calling sequence of the addFilterBefore be changed.

Open vinchauhan opened this issue 9 years ago • 3 comments
trafficstars

.addFilterBefore(new TokenAuthFilter(tokenAuthService), UsernamePasswordAuthenticationFilter.class) .addFilterBefore(new LoginFilter("/auth/login", authenticationManager(), tokenAuthService), UsernamePasswordAuthenticationFilter.class);

Should be -

.addFilterBefore(new LoginFilter("/auth/login", authenticationManager(), tokenAuthService), UsernamePasswordAuthenticationFilter.class); .addFilterBefore(new TokenAuthFilter(tokenAuthService), UsernamePasswordAuthenticationFilter.class)

vinchauhan avatar Sep 15 '16 18:09 vinchauhan

Yes, I you're right. Can you please make a pull request?

marcushellberg avatar Sep 15 '16 20:09 marcushellberg

Sure I will send one..later.

Thanks

vinchauhan avatar Sep 15 '16 21:09 vinchauhan

I did a build and ran on local. It worked fine with the way it is. I dont think it needs a change but for some reason I feel if "/auth/login" filter is not loaded first then we might run into a null pointer exception in getAuthentication()... I will not change since it works the way it is.

Thanks.

vinchauhan avatar Sep 16 '16 05:09 vinchauhan