Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //https://auth0.com/blog/implementing-jwt-authentication-on-spring-boot/
- @Override
- protected void configure(HttpSecurity http) throws Exception {
- http.cors().and().csrf().disable().authorizeRequests()
- .antMatchers(HttpMethod.POST, SIGN_UP_URL).permitAll()
- .anyRequest().authenticated()
- .and()
- //autoryzacja i autentykacja, to jest dosc logiczne.
- //public class JWTAuthenticationFilter extends UsernamePasswordAuthenticationFilter
- //public class JWTAuthorizationFilter extends BasicAuthenticationFilter
- .addFilter(new JWTAuthenticationFilter(authenticationManager()))
- .addFilter(new JWTAuthorizationFilter(authenticationManager()))
- .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS);
- }
Advertisement
Add Comment
Please, Sign In to add comment