Guest User

Untitled

a guest
Dec 26th, 2017
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. //https://auth0.com/blog/implementing-jwt-authentication-on-spring-boot/
  2.  
  3. @Override
  4. protected void configure(HttpSecurity http) throws Exception {
  5. http.cors().and().csrf().disable().authorizeRequests()
  6. .antMatchers(HttpMethod.POST, SIGN_UP_URL).permitAll()
  7. .anyRequest().authenticated()
  8. .and()
  9.  
  10. //autoryzacja i autentykacja, to jest dosc logiczne.
  11. //public class JWTAuthenticationFilter extends UsernamePasswordAuthenticationFilter
  12. //public class JWTAuthorizationFilter extends BasicAuthenticationFilter
  13. .addFilter(new JWTAuthenticationFilter(authenticationManager()))
  14. .addFilter(new JWTAuthorizationFilter(authenticationManager()))
  15. .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS);
  16. }
Advertisement
Add Comment
Please, Sign In to add comment