Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- POST http://localhost:4200/proxy/user/createUser 401 (Unauthorized)
- @Configuration
- @EnableWebSecurity
- public class WebSecurity extends WebSecurityConfigurerAdapter {
- @Override
- protected void configure(HttpSecurity http) throws Exception {
- http.authorizeRequests().antMatchers("/createUser", "/user/**", "/user/createUser", "proxy/user/createUser").permitAll();
- http.csrf().disable();
- http.formLogin().disable();
- http.authorizeRequests().anyRequest().authenticated();
- }
- }
- @Configuration
- @EnableResourceServer
- public class ResourceServerConfig extends ResourceServerConfigurerAdapter {
- @Override
- public void configure(HttpSecurity http) throws Exception {
- http.authorizeRequests().antMatchers("/createUser", "/register", "/token", "/token/createUser", "proxy/user/createUser").permitAll();
- http.requestMatchers()
- .and()
- .authorizeRequests()
- .anyRequest()
- .authenticated();
- }
- }
- @Override
- protected void configure(HttpSecurity http) throws Exception {
- http.csrf().disable()
- .authorizeRequests().antMatchers("/createUser", "/user/**", "/user/createUser", "proxy/user/createUser")
- .permitAll()
- .formLogin().disable();
- }}`
Add Comment
Please, Sign In to add comment