Guest User

Untitled

a guest
Jul 16th, 2018
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. POST http://localhost:4200/proxy/user/createUser 401 (Unauthorized)
  2.  
  3. @Configuration
  4. @EnableWebSecurity
  5. public class WebSecurity extends WebSecurityConfigurerAdapter {
  6.  
  7. @Override
  8. protected void configure(HttpSecurity http) throws Exception {
  9. http.authorizeRequests().antMatchers("/createUser", "/user/**", "/user/createUser", "proxy/user/createUser").permitAll();
  10. http.csrf().disable();
  11. http.formLogin().disable();
  12. http.authorizeRequests().anyRequest().authenticated();
  13. }
  14. }
  15.  
  16. @Configuration
  17. @EnableResourceServer
  18. public class ResourceServerConfig extends ResourceServerConfigurerAdapter {
  19.  
  20. @Override
  21. public void configure(HttpSecurity http) throws Exception {
  22. http.authorizeRequests().antMatchers("/createUser", "/register", "/token", "/token/createUser", "proxy/user/createUser").permitAll();
  23. http.requestMatchers()
  24. .and()
  25. .authorizeRequests()
  26. .anyRequest()
  27. .authenticated();
  28. }
  29. }
  30.  
  31. @Override
  32. protected void configure(HttpSecurity http) throws Exception {
  33. http.csrf().disable()
  34. .authorizeRequests().antMatchers("/createUser", "/user/**", "/user/createUser", "proxy/user/createUser")
  35. .permitAll()
  36. .formLogin().disable();
  37.  
  38. }}`
Add Comment
Please, Sign In to add comment