研究下 OAuth2 进行改造

This commit is contained in:
YunaiV
2020-06-25 14:01:25 +08:00
parent 6be1196e9e
commit 61a6106707
4 changed files with 9 additions and 7 deletions

View File

@@ -39,10 +39,10 @@
</dependency>
<!-- 实现对 Spring Security 的自动配置 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.springframework.boot</groupId>-->
<!-- <artifactId>spring-boot-starter-security</artifactId>-->
<!-- </dependency>-->
<!-- 实现对 Spring Security OAuth2 的自动配置 -->
<dependency>

View File

@@ -29,8 +29,9 @@ public class OAuth2AuthorizationServerConfig extends AuthorizationServerConfigur
@Override
public void configure(AuthorizationServerSecurityConfigurer oauthServer) throws Exception {
oauthServer.tokenKeyAccess("isAuthenticated()")
.checkTokenAccess("isAuthenticated()");
oauthServer.checkTokenAccess("isAuthenticated()");
// oauthServer.tokenKeyAccess("isAuthenticated()")
// .checkTokenAccess("isAuthenticated()");
// oauthServer.tokenKeyAccess("permitAll()")
// .checkTokenAccess("permitAll()");
}

View File

@@ -12,3 +12,4 @@ security:
token-info-uri: http://127.0.0.1:8080/oauth/check_token # 获得 Token 信息的 URL
# 访问令牌获取 URL自定义的
access-token-uri: http://127.0.0.1:8080/oauth/token

View File

@@ -13,7 +13,7 @@
<!-- Spring Boot 示例 -->
<!-- <module>lab-01</module>-->
<!-- <module>lab-02</module>-->
<!-- <module>lab-03</module>-->
<!-- <module>lab-03</module>-->
<!-- <module>lab-04</module>-->
<!-- <module>lab-05</module>-->
<!-- <module>lab-06</module>-->