Commit 5151c880 authored by renjie's avatar renjie

oauth认证bug

parent 66be1dde
......@@ -17,12 +17,14 @@ public class ResourceServerConfiguration extends ResourceServerConfigurerAdapter
@Override
public void configure(HttpSecurity http) throws Exception {
http.exceptionHandling()
.and()
.logout()
.logoutUrl("/oauth/logout")
.and()
http
.authorizeRequests()
.antMatchers("/secure/**").authenticated();
.antMatchers("/user/*")
.authenticated()
.antMatchers("/oauth/**").permitAll()
.antMatchers("/shop/*","/ip/*","/group/*").authenticated()
.and()
//关闭跨站请求防护
.csrf().disable();
}
}
\ No newline at end of file
......@@ -8,12 +8,14 @@ import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.builders.WebSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
/**
* @author cdov
*/
@EnableWebSecurity
@Configuration
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
......@@ -30,8 +32,8 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
public void configure(WebSecurity web) throws Exception {
web.ignoring()
.antMatchers( "/account/authCode", "/user/signup",
"/user/reset*", "/token");
.antMatchers( "/user/authCode", "/user/signUp",
"/user/reset*");
}
@Override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment