Skip to content

Commit 977d593

Browse files
author
yuit
committed
1. 配置token存储类型增加jdbc,已测试通过 2.修复 [#4](#4)
1 parent f9c9927 commit 977d593

File tree

65 files changed

+240
-259
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+240
-259
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ spring-security ,spring-security-oauth2 ,string boot 学习
44

55
---
66

7+
### 更新
8+
79
#### 目前功能
810
1. 授权码模式,密码模式,简化模式(未测试),客户端模式(未测试)
911
2. JWT
@@ -54,7 +56,7 @@ boot:
5456
#### 建表语句在src/doc/table.sql中
5557
5658
相关的测试数据也在这个sql文件中,加密的密码统一为123qwe
57-
59+
5860
#### 注
5961
6062
请使用上述依赖所规定的版本

UPDATE.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
### 2019/2/15 更新
2+
1. 配置token存储类型增加jdbc,已测试通过
3+
```
4+
使用jdbc时必须创建的表的SQL语句在/src/doc/table.sql中,建表语句参考 :
5+
https://github.com/spring-projects/spring-security-oauth/blob/master/spring-security-oauth2/src/test/resources/schema.sql
6+
```
7+
2. 修复 [#4](https://github.com/LookBackInTheRain/oauth-boot/issues/4)

pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,11 @@
159159
<artifactId>spring-boot-starter-thymeleaf</artifactId>
160160
</dependency>
161161

162+
163+
164+
165+
166+
162167
</dependencies>
163168

164169
<build>

src/doc/table.sql

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,24 @@ create table clients (
3838
INSERT INTO boot.user (id, username, password, gender, email, isEnable, isExpired, isLocked) VALUES ('67842834823', 'admin', '$2a$10$06S5v7Mo47e8Qyv65Ltz.uhcQwfhIcgYDKVPVzBlPj6UHWV2ErbzK', '', '阿斯达@as.com', true, false, true);
3939

4040
-- clients 测试数据 密码123qwe
41-
INSERT INTO boot.clients (id, clientId, resourceIds, isSecretRequired, clientSecret, isScoped, scope, authorizedGrantTypes, registeredRedirectUri, authorities, isAutoApprove, accessTokenValiditySeconds, refreshTokenValiditySeconds, createTime, modifyTime) VALUES ('JKGJHGJHFGH89867', 'client', 'boot-server', true, '$2a$10$06S5v7Mo47e8Qyv65Ltz.uhcQwfhIcgYDKVPVzBlPj6UHWV2ErbzK', true, 'select', 'refresh_token,authorization_code,password', 'http://localhost:9000', 'CLIENT,ADMIN', false, 1800, 36000, '2018-10-16 10:02:14', '2018-12-14 09:05:03');
41+
INSERT INTO boot.clients (id, clientId, resourceIds, isSecretRequired, clientSecret, isScoped, scope, authorizedGrantTypes, registeredRedirectUri, authorities, isAutoApprove, accessTokenValiditySeconds, refreshTokenValiditySeconds, createTime, modifyTime) VALUES ('JKGJHGJHFGH89867', 'client', 'boot-server', true, '$2a$10$06S5v7Mo47e8Qyv65Ltz.uhcQwfhIcgYDKVPVzBlPj6UHWV2ErbzK', true, 'select', 'refresh_token,authorization_code,password', 'http://localhost:9000', 'CLIENT,ADMIN', false, 1800, 36000, '2018-10-16 10:02:14', '2018-12-14 09:05:03');
42+
43+
44+
-- 当token-store-type: jdbc时 需要创建如下两张表
45+
create table oauth_access_token
46+
(
47+
token_id VARCHAR(255),
48+
token longblob,
49+
authentication_id VARCHAR(255) PRIMARY KEY,
50+
user_name VARCHAR(255),
51+
client_id VARCHAR(255),
52+
authentication longblob,
53+
refresh_token VARCHAR(255)
54+
);
55+
56+
create table oauth_refresh_token
57+
(
58+
token_id VARCHAR(256),
59+
token longblob,
60+
authentication longblob
61+
);

src/main/java/club/yuit/CodeGenerator.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,8 @@
1616

1717
/**
1818
* @author yuit
19-
* @create time 2018/10/9 17:24
20-
* @description 代码生成器
21-
* @modify by
22-
* @modify time
19+
* @date 2018/10/9 17:24
20+
* 代码生成器
2321
**/
2422
public class CodeGenerator {
2523

src/main/java/club/yuit/oauth/boot/authentication/mobile/SmsAuthenticationProvider.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,8 @@
1111
import org.springframework.security.core.userdetails.UserDetailsService;
1212

1313
/**
14-
* @auther yuit
15-
* @create 2018/10/19 15:33
16-
* @description
17-
* @modify
14+
* @author yuit
15+
* @date 2018/10/19 15:33
1816
*/
1917
@Getter
2018
@Setter

src/main/java/club/yuit/oauth/boot/authentication/mobile/SmsCodeAuthenticationFilter.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,8 @@
1111
import javax.servlet.http.HttpServletResponse;
1212

1313
/**
14-
* @auther yuit
15-
* @create 2018/10/19 15:24
16-
* @description
17-
* @modify
14+
* @author yuit
15+
* @date 2018/10/19 15:33
1816
*/
1917
public class SmsCodeAuthenticationFilter extends AbstractAuthenticationProcessingFilter {
2018
// ~ Static fields/initializers

src/main/java/club/yuit/oauth/boot/authentication/mobile/SmsCodeAuthenticationToken.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,8 @@
77
import java.util.Collection;
88

99
/**
10-
* @auther yuit
11-
* @create 2018/10/19 15:17
12-
* @description
13-
* @modify
10+
* @author yuit
11+
* @date 2018/10/19 15:33
1412
*/
1513
public class SmsCodeAuthenticationToken extends AbstractAuthenticationToken {
1614

src/main/java/club/yuit/oauth/boot/authentication/mobile/SmsCodeCheckFilter.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,8 @@
1818
import java.io.IOException;
1919

2020
/**
21-
* @auther yuit
22-
* @create 2018/10/19 15:56
23-
* @description
24-
* @modify
21+
* @author yuit
22+
* @date 2018/10/19 15:33
2523
*/
2624
@Getter
2725
@Setter

src/main/java/club/yuit/oauth/boot/config/CoreConfig.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,7 @@
2727

2828
/**
2929
* @author yuit
30-
* @create time 2018/10/9 15:08
31-
* @description
32-
* @modify by
33-
* @modify time
30+
* @date 2018/10/9 15:08
3431
**/
3532
@Configuration
3633
@EnableSwagger2
@@ -44,13 +41,10 @@ public void addResourceHandlers(ResourceHandlerRegistry registry) {
4441

4542
/**
4643
* Could not resolve view with name 'forward:/oauth/confirm_access' in servlet with name 'dispatcherServlet'
47-
* @param registry
44+
*
4845
*/
4946
/*@Override
5047
protected void configureViewResolvers(ViewResolverRegistry registry) {
51-
52-
53-
5448
registry.viewResolver(new InternalResourceViewResolver());
5549
}*/
5650

0 commit comments

Comments
 (0)