Commit e4925b28 authored by maqing's avatar maqing

代码回滚

parent 8c35e106
...@@ -66,16 +66,6 @@ public class AuthorizationServerConfiguration extends AuthorizationServerConfigu ...@@ -66,16 +66,6 @@ public class AuthorizationServerConfiguration extends AuthorizationServerConfigu
@Override @Override
public void configure(ClientDetailsServiceConfigurer clients) throws Exception { public void configure(ClientDetailsServiceConfigurer clients) throws Exception {
clients.withClientDetails(clientDetails()); clients.withClientDetails(clientDetails());
clients.inMemory()
.withClient("password")
/*
* 表示OAuth 2中的授权模式为“password”和“refresh_token”两种
* 在标准的OAuth 2协议中,授权模式并不包括“refresh_token”,但是在Spring Security的实现中将其归为一种,
* 因此如果要实现access_token的刷新,就需要添加这样一种授权模式
*/
.authorizedGrantTypes("password", "refresh_token")
.accessTokenValiditySeconds(1800); // 配置了access_token的过期时间
} }
/** /**
......
...@@ -21,10 +21,8 @@ import org.springframework.security.web.authentication.logout.SecurityContextLog ...@@ -21,10 +21,8 @@ import org.springframework.security.web.authentication.logout.SecurityContextLog
*/ */
@Configuration @Configuration
@EnableWebSecurity @EnableWebSecurity
@EnableGlobalMethodSecurity(prePostEnabled = true,securedEnabled = true)
@Order(1) @Order(1)
public class WebSecurityConfig extends WebSecurityConfigurerAdapter { public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
LogoutSuccessHandler logoutSuccessHandlerl;
/** /**
* 配置用户的安全拦截策略 * 配置用户的安全拦截策略
......
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