Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
有来技术
youlai-mall
比较版本
96e39c445a2eb242bb7dfa4e20fa9549c641a8ae...572a756d93ed1caf0f3e13654367758d1e7904b9
Y
youlai-mall
项目概览
有来技术
/
youlai-mall
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Y
youlai-mall
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
源分支
572a756d93ed1caf0f3e13654367758d1e7904b9
选择Git版本
...
目标分支
96e39c445a2eb242bb7dfa4e20fa9549c641a8ae
选择Git版本
比较
Commits (2)
https://gitcode.net/u013737132/youlai-mall/-/commit/e846a808a52f6a59cdd8ff74dfe4e7694c3333da
chore: 移动端自定义授权模式`grant_type`修改
2024-03-08T00:12:35+08:00
hxr
1490493387@qq.com
https://gitcode.net/u013737132/youlai-mall/-/commit/572a756d93ed1caf0f3e13654367758d1e7904b9
refactor: 日志打印优化
2024-03-08T00:13:10+08:00
hxr
1490493387@qq.com
隐藏空白更改
内联
并排
Showing
3 changed file
with
3 addition
and
4 deletion
+3
-4
docs/sql/mysql5/oauth2_server.sql
docs/sql/mysql5/oauth2_server.sql
+1
-1
docs/sql/mysql8/oauth2_server.sql
docs/sql/mysql8/oauth2_server.sql
+1
-1
youlai-auth/src/main/java/com/youlai/auth/oauth2/extension/miniapp/WxMiniAppAuthenticationProvider.java
...h2/extension/miniapp/WxMiniAppAuthenticationProvider.java
+1
-2
未找到文件。
docs/sql/mysql5/oauth2_server.sql
浏览文件 @
572a756d
...
...
@@ -82,7 +82,7 @@ CREATE TABLE oauth2_registered_client (
-- ----------------------------
-- Records of oauth2_registered_client
-- ----------------------------
INSERT
INTO
`oauth2_registered_client`
VALUES
(
'0d2eb3c4-bab5-4973-a64e-2c5c3898e249'
,
'mall-app'
,
now
(),
'{bcrypt}$2a$10$OqbaoJTZyCnnBLhtaAKumONuMuwfigqRzjicx4B2Lqy3YsgTBF9Hq'
,
NULL
,
'商城APP客户端'
,
'client_secret_basic'
,
'refresh_token,client_credentials,authorization_code,sms
_code
,wx_mini_app'
,
'http://127.0.0.1:8080/authorized'
,
'http://127.0.0.1:8080/logged-out'
,
'openid,profile'
,
'{
\"
@class
\"
:
\"
java.util.Collections$UnmodifiableMap
\"
,
\"
settings.client.require-proof-key
\"
:false,
\"
settings.client.require-authorization-consent
\"
:true}'
,
'{
\"
@class
\"
:
\"
java.util.Collections$UnmodifiableMap
\"
,
\"
settings.token.reuse-refresh-tokens
\"
:true,
\"
settings.token.id-token-signature-algorithm
\"
:[
\"
org.springframework.security.oauth2.jose.jws.SignatureAlgorithm
\"
,
\"
RS256
\"
],
\"
settings.token.access-token-time-to-live
\"
:[
\"
java.time.Duration
\"
,86400.000000000],
\"
settings.token.access-token-format
\"
:{
\"
@class
\"
:
\"
org.springframework.security.oauth2.server.authorization.settings.OAuth2TokenFormat
\"
,
\"
value
\"
:
\"
self-contained
\"
},
\"
settings.token.refresh-token-time-to-live
\"
:[
\"
java.time.Duration
\"
,3600.000000000],
\"
settings.token.authorization-code-time-to-live
\"
:[
\"
java.time.Duration
\"
,300.000000000],
\"
settings.token.device-code-time-to-live
\"
:[
\"
java.time.Duration
\"
,300.000000000]}'
);
INSERT
INTO
`oauth2_registered_client`
VALUES
(
'0d2eb3c4-bab5-4973-a64e-2c5c3898e249'
,
'mall-app'
,
now
(),
'{bcrypt}$2a$10$OqbaoJTZyCnnBLhtaAKumONuMuwfigqRzjicx4B2Lqy3YsgTBF9Hq'
,
NULL
,
'商城APP客户端'
,
'client_secret_basic'
,
'refresh_token,client_credentials,authorization_code,sms,wx_mini_app'
,
'http://127.0.0.1:8080/authorized'
,
'http://127.0.0.1:8080/logged-out'
,
'openid,profile'
,
'{
\"
@class
\"
:
\"
java.util.Collections$UnmodifiableMap
\"
,
\"
settings.client.require-proof-key
\"
:false,
\"
settings.client.require-authorization-consent
\"
:true}'
,
'{
\"
@class
\"
:
\"
java.util.Collections$UnmodifiableMap
\"
,
\"
settings.token.reuse-refresh-tokens
\"
:true,
\"
settings.token.id-token-signature-algorithm
\"
:[
\"
org.springframework.security.oauth2.jose.jws.SignatureAlgorithm
\"
,
\"
RS256
\"
],
\"
settings.token.access-token-time-to-live
\"
:[
\"
java.time.Duration
\"
,86400.000000000],
\"
settings.token.access-token-format
\"
:{
\"
@class
\"
:
\"
org.springframework.security.oauth2.server.authorization.settings.OAuth2TokenFormat
\"
,
\"
value
\"
:
\"
self-contained
\"
},
\"
settings.token.refresh-token-time-to-live
\"
:[
\"
java.time.Duration
\"
,3600.000000000],
\"
settings.token.authorization-code-time-to-live
\"
:[
\"
java.time.Duration
\"
,300.000000000],
\"
settings.token.device-code-time-to-live
\"
:[
\"
java.time.Duration
\"
,300.000000000]}'
);
INSERT
INTO
`oauth2_registered_client`
VALUES
(
'94aa75c2-1c00-44d5-a1ff-edb18f8ad9c4'
,
'mall-admin'
,
now
(),
'{bcrypt}$2a$10$9klpwOFEl1zeWlATOYNFYeHoWuDsb160od86/cJrJG8Ik.7fQNOaC'
,
NULL
,
'商城管理客户端'
,
'client_secret_basic'
,
'refresh_token,client_credentials,password,captcha,authorization_code'
,
'http://127.0.0.1:8080/authorized'
,
'http://127.0.0.1:8080/logged-out'
,
'openid,profile'
,
'{
\"
@class
\"
:
\"
java.util.Collections$UnmodifiableMap
\"
,
\"
settings.client.require-proof-key
\"
:false,
\"
settings.client.require-authorization-consent
\"
:true}'
,
'{
\"
@class
\"
:
\"
java.util.Collections$UnmodifiableMap
\"
,
\"
settings.token.reuse-refresh-tokens
\"
:true,
\"
settings.token.id-token-signature-algorithm
\"
:[
\"
org.springframework.security.oauth2.jose.jws.SignatureAlgorithm
\"
,
\"
RS256
\"
],
\"
settings.token.access-token-time-to-live
\"
:[
\"
java.time.Duration
\"
,86400.000000000],
\"
settings.token.access-token-format
\"
:{
\"
@class
\"
:
\"
org.springframework.security.oauth2.server.authorization.settings.OAuth2TokenFormat
\"
,
\"
value
\"
:
\"
self-contained
\"
},
\"
settings.token.refresh-token-time-to-live
\"
:[
\"
java.time.Duration
\"
,3600.000000000],
\"
settings.token.authorization-code-time-to-live
\"
:[
\"
java.time.Duration
\"
,300.000000000],
\"
settings.token.device-code-time-to-live
\"
:[
\"
java.time.Duration
\"
,300.000000000]}'
);
INSERT
INTO
`oauth2_registered_client`
VALUES
(
'94aa75c2-1c00-44d5-a1ff-edb18f8ad9c5'
,
'client'
,
now
(),
'{bcrypt}$2a$10$T2Z9XX60zjBS0pwXZmqe1.uEf6OJiPEUhGKZg5b0SnZPwtvlxESJ2'
,
NULL
,
'商城管理客户端'
,
'client_secret_basic'
,
'refresh_token,client_credentials,password,captcha,authorization_code'
,
'http://127.0.0.1:8080/authorized'
,
'http://127.0.0.1:8080/logged-out'
,
'openid,profile'
,
'{
\"
@class
\"
:
\"
java.util.Collections$UnmodifiableMap
\"
,
\"
settings.client.require-proof-key
\"
:false,
\"
settings.client.require-authorization-consent
\"
:true}'
,
'{
\"
@class
\"
:
\"
java.util.Collections$UnmodifiableMap
\"
,
\"
settings.token.reuse-refresh-tokens
\"
:true,
\"
settings.token.id-token-signature-algorithm
\"
:[
\"
org.springframework.security.oauth2.jose.jws.SignatureAlgorithm
\"
,
\"
RS256
\"
],
\"
settings.token.access-token-time-to-live
\"
:[
\"
java.time.Duration
\"
,86400.000000000],
\"
settings.token.access-token-format
\"
:{
\"
@class
\"
:
\"
org.springframework.security.oauth2.server.authorization.settings.OAuth2TokenFormat
\"
,
\"
value
\"
:
\"
self-contained
\"
},
\"
settings.token.refresh-token-time-to-live
\"
:[
\"
java.time.Duration
\"
,3600.000000000],
\"
settings.token.authorization-code-time-to-live
\"
:[
\"
java.time.Duration
\"
,300.000000000],
\"
settings.token.device-code-time-to-live
\"
:[
\"
java.time.Duration
\"
,300.000000000]}'
);
docs/sql/mysql8/oauth2_server.sql
浏览文件 @
572a756d
...
...
@@ -77,6 +77,6 @@ CREATE TABLE oauth2_registered_client (
-- ----------------------------
-- Records of oauth2_registered_client
-- ----------------------------
INSERT
INTO
`oauth2_registered_client`
VALUES
(
'0d2eb3c4-bab5-4973-a64e-2c5c3898e249'
,
'mall-app'
,
now
(),
'{bcrypt}$2a$10$OqbaoJTZyCnnBLhtaAKumONuMuwfigqRzjicx4B2Lqy3YsgTBF9Hq'
,
NULL
,
'商城APP客户端'
,
'client_secret_basic'
,
'refresh_token,client_credentials,authorization_code,sms
_code
,wx_mini_app'
,
'http://127.0.0.1:8080/authorized'
,
'http://127.0.0.1:8080/logged-out'
,
'openid,profile'
,
'{
\"
@class
\"
:
\"
java.util.Collections$UnmodifiableMap
\"
,
\"
settings.client.require-proof-key
\"
:false,
\"
settings.client.require-authorization-consent
\"
:true}'
,
'{
\"
@class
\"
:
\"
java.util.Collections$UnmodifiableMap
\"
,
\"
settings.token.reuse-refresh-tokens
\"
:true,
\"
settings.token.id-token-signature-algorithm
\"
:[
\"
org.springframework.security.oauth2.jose.jws.SignatureAlgorithm
\"
,
\"
RS256
\"
],
\"
settings.token.access-token-time-to-live
\"
:[
\"
java.time.Duration
\"
,86400.000000000],
\"
settings.token.access-token-format
\"
:{
\"
@class
\"
:
\"
org.springframework.security.oauth2.server.authorization.settings.OAuth2TokenFormat
\"
,
\"
value
\"
:
\"
self-contained
\"
},
\"
settings.token.refresh-token-time-to-live
\"
:[
\"
java.time.Duration
\"
,3600.000000000],
\"
settings.token.authorization-code-time-to-live
\"
:[
\"
java.time.Duration
\"
,300.000000000],
\"
settings.token.device-code-time-to-live
\"
:[
\"
java.time.Duration
\"
,300.000000000]}'
);
INSERT
INTO
`oauth2_registered_client`
VALUES
(
'0d2eb3c4-bab5-4973-a64e-2c5c3898e249'
,
'mall-app'
,
now
(),
'{bcrypt}$2a$10$OqbaoJTZyCnnBLhtaAKumONuMuwfigqRzjicx4B2Lqy3YsgTBF9Hq'
,
NULL
,
'商城APP客户端'
,
'client_secret_basic'
,
'refresh_token,client_credentials,authorization_code,sms,wx_mini_app'
,
'http://127.0.0.1:8080/authorized'
,
'http://127.0.0.1:8080/logged-out'
,
'openid,profile'
,
'{
\"
@class
\"
:
\"
java.util.Collections$UnmodifiableMap
\"
,
\"
settings.client.require-proof-key
\"
:false,
\"
settings.client.require-authorization-consent
\"
:true}'
,
'{
\"
@class
\"
:
\"
java.util.Collections$UnmodifiableMap
\"
,
\"
settings.token.reuse-refresh-tokens
\"
:true,
\"
settings.token.id-token-signature-algorithm
\"
:[
\"
org.springframework.security.oauth2.jose.jws.SignatureAlgorithm
\"
,
\"
RS256
\"
],
\"
settings.token.access-token-time-to-live
\"
:[
\"
java.time.Duration
\"
,86400.000000000],
\"
settings.token.access-token-format
\"
:{
\"
@class
\"
:
\"
org.springframework.security.oauth2.server.authorization.settings.OAuth2TokenFormat
\"
,
\"
value
\"
:
\"
self-contained
\"
},
\"
settings.token.refresh-token-time-to-live
\"
:[
\"
java.time.Duration
\"
,3600.000000000],
\"
settings.token.authorization-code-time-to-live
\"
:[
\"
java.time.Duration
\"
,300.000000000],
\"
settings.token.device-code-time-to-live
\"
:[
\"
java.time.Duration
\"
,300.000000000]}'
);
INSERT
INTO
`oauth2_registered_client`
VALUES
(
'94aa75c2-1c00-44d5-a1ff-edb18f8ad9c4'
,
'mall-admin'
,
now
(),
'{bcrypt}$2a$10$9klpwOFEl1zeWlATOYNFYeHoWuDsb160od86/cJrJG8Ik.7fQNOaC'
,
NULL
,
'商城管理客户端'
,
'client_secret_basic'
,
'refresh_token,client_credentials,password,captcha,authorization_code'
,
'http://127.0.0.1:8080/authorized'
,
'http://127.0.0.1:8080/logged-out'
,
'openid,profile'
,
'{
\"
@class
\"
:
\"
java.util.Collections$UnmodifiableMap
\"
,
\"
settings.client.require-proof-key
\"
:false,
\"
settings.client.require-authorization-consent
\"
:true}'
,
'{
\"
@class
\"
:
\"
java.util.Collections$UnmodifiableMap
\"
,
\"
settings.token.reuse-refresh-tokens
\"
:true,
\"
settings.token.id-token-signature-algorithm
\"
:[
\"
org.springframework.security.oauth2.jose.jws.SignatureAlgorithm
\"
,
\"
RS256
\"
],
\"
settings.token.access-token-time-to-live
\"
:[
\"
java.time.Duration
\"
,86400.000000000],
\"
settings.token.access-token-format
\"
:{
\"
@class
\"
:
\"
org.springframework.security.oauth2.server.authorization.settings.OAuth2TokenFormat
\"
,
\"
value
\"
:
\"
self-contained
\"
},
\"
settings.token.refresh-token-time-to-live
\"
:[
\"
java.time.Duration
\"
,3600.000000000],
\"
settings.token.authorization-code-time-to-live
\"
:[
\"
java.time.Duration
\"
,300.000000000],
\"
settings.token.device-code-time-to-live
\"
:[
\"
java.time.Duration
\"
,300.000000000]}'
);
INSERT
INTO
`oauth2_registered_client`
VALUES
(
'94aa75c2-1c00-44d5-a1ff-edb18f8ad9c5'
,
'client'
,
now
(),
'{bcrypt}$2a$10$T2Z9XX60zjBS0pwXZmqe1.uEf6OJiPEUhGKZg5b0SnZPwtvlxESJ2'
,
NULL
,
'商城管理客户端'
,
'client_secret_basic'
,
'refresh_token,client_credentials,password,captcha,authorization_code'
,
'http://127.0.0.1:8080/authorized'
,
'http://127.0.0.1:8080/logged-out'
,
'openid,profile'
,
'{
\"
@class
\"
:
\"
java.util.Collections$UnmodifiableMap
\"
,
\"
settings.client.require-proof-key
\"
:false,
\"
settings.client.require-authorization-consent
\"
:true}'
,
'{
\"
@class
\"
:
\"
java.util.Collections$UnmodifiableMap
\"
,
\"
settings.token.reuse-refresh-tokens
\"
:true,
\"
settings.token.id-token-signature-algorithm
\"
:[
\"
org.springframework.security.oauth2.jose.jws.SignatureAlgorithm
\"
,
\"
RS256
\"
],
\"
settings.token.access-token-time-to-live
\"
:[
\"
java.time.Duration
\"
,86400.000000000],
\"
settings.token.access-token-format
\"
:{
\"
@class
\"
:
\"
org.springframework.security.oauth2.server.authorization.settings.OAuth2TokenFormat
\"
,
\"
value
\"
:
\"
self-contained
\"
},
\"
settings.token.refresh-token-time-to-live
\"
:[
\"
java.time.Duration
\"
,3600.000000000],
\"
settings.token.authorization-code-time-to-live
\"
:[
\"
java.time.Duration
\"
,300.000000000],
\"
settings.token.device-code-time-to-live
\"
:[
\"
java.time.Duration
\"
,300.000000000]}'
);
youlai-auth/src/main/java/com/youlai/auth/oauth2/extension/miniapp/WxMiniAppAuthenticationProvider.java
浏览文件 @
572a756d
...
...
@@ -92,7 +92,7 @@ public class WxMiniAppAuthenticationProvider implements AuthenticationProvider {
try
{
sessionInfo
=
wxMaService
.
getUserService
().
getSessionInfo
(
code
);
}
catch
(
WxErrorException
e
)
{
e
.
printStackTrace
(
);
log
.
error
(
"微信小程序登录失败"
,
e
);
throw
new
OAuth2AuthenticationException
(
e
.
getMessage
());
}
String
openid
=
sessionInfo
.
getOpenid
();
...
...
@@ -146,7 +146,6 @@ public class WxMiniAppAuthenticationProvider implements AuthenticationProvider {
throw
new
OAuth2AuthenticationException
(
error
);
}
refreshToken
=
(
OAuth2RefreshToken
)
generatedRefreshToken
;
authorizationBuilder
.
refreshToken
(
refreshToken
);
}
...
...