mirror of
https://gitee.com/yudaocode/SpringBoot-Labs.git
synced 2026-09-03 05:53:54 +08:00
研究下 OAuth2 进行改造
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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()");
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user