File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -237,6 +237,14 @@ $ nginx -s reload
237
237
238
238
## 2. 主要代码
239
239
240
+ > 本 demo 采用 Redis 缓存 state,所以请准备 Redis 环境,如果没有 Redis 环境,可以将配置文件的缓存配置为
241
+ >
242
+ > ``` yaml
243
+ > justauth:
244
+ > cache:
245
+ > type: default
246
+ > ```
247
+
240
248
# ## 2.1. pom.xml
241
249
242
250
` ` ` xml
@@ -262,7 +270,7 @@ $ nginx -s reload
262
270
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
263
271
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
264
272
<java.version>1.8</java.version>
265
- <justauth-spring-boot .version>1.0 .0</justauth-spring-boot .version>
273
+ <justauth-spring-boot.version>1.1 .0</justauth-spring-boot.version>
266
274
</properties>
267
275
268
276
<dependencies>
@@ -386,6 +394,10 @@ justauth:
386
394
client-secret: 8G6PCr00j************************rgk************AyzaPc78
387
395
redirect-uri: http://oauth.xkcoding.com/demo/oauth/wechat_enterprise/callback
388
396
agent-id: 1*******2
397
+ cache:
398
+ type: redis
399
+ prefix: 'SOCIAL::STATE::'
400
+ timeout: 1h
389
401
` ` `
390
402
391
403
# ## 2.3. OauthController.java
@@ -460,7 +472,7 @@ public class OauthController {
460
472
461
473
# ## 2.4. 如果想要自定义 state 缓存
462
474
463
- 请看👉[ 这里] ( https://github.com/xkcoding/spring-boot-demo/tree/master/ spring-boot-demo-social/src/main/java/com/xkcoding/social/config/justauth )
475
+ 请看👉[这里](https://github.com/justauth/justauth- spring-boot-starter#2-%E7%BC%93%E5%AD%98%E9%85%8D%E7%BD%AE )
464
476
465
477
# # 3. 运行方式
466
478
You can’t perform that action at this time.
0 commit comments