Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
yujianwangzivayy
MaxKey
提交
be866135
MaxKey
项目概览
yujianwangzivayy
/
MaxKey
与 Fork 源项目一致
Fork自
MaxKey单点登录官方(MaxKeyTop) / MaxKey
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
MaxKey
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
be866135
编写于
10月 30, 2020
作者:
MaxKey单点登录官方
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
社交账号登录优化
上级
a794a945
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
57 addition
and
38 deletion
+57
-38
ReleaseNotes.txt
ReleaseNotes.txt
+2
-0
build.gradle
build.gradle
+2
-2
maxkey-authentications/src/main/java/org/maxkey/authn/support/socialsignon/SocialSignOnEndpoint.java
...xkey/authn/support/socialsignon/SocialSignOnEndpoint.java
+45
-34
maxkey-core/src/main/resources/messages/passwordpolicy_message.properties
...main/resources/messages/passwordpolicy_message.properties
+2
-0
maxkey-core/src/main/resources/messages/passwordpolicy_message_en.properties
...n/resources/messages/passwordpolicy_message_en.properties
+3
-1
maxkey-core/src/main/resources/messages/passwordpolicy_message_zh_CN.properties
...esources/messages/passwordpolicy_message_zh_CN.properties
+3
-1
未找到文件。
ReleaseNotes.txt
浏览文件 @
be866135
...
@@ -12,6 +12,8 @@
...
@@ -12,6 +12,8 @@
*(MAXKEY-200912) 构建脚本的优化和更新
*(MAXKEY-200912) 构建脚本的优化和更新
*(MAXKEY-200920) 依赖jar引用、更新和升级
*(MAXKEY-200920) 依赖jar引用、更新和升级
druid 1.2.1
druid 1.2.1
JustAuth 1.15.8
simple-http 1.0.3
spring-session 2.3.1.RELEASE
spring-session 2.3.1.RELEASE
druid-spring-boot-starter 1.2.1
druid-spring-boot-starter 1.2.1
...
...
build.gradle
浏览文件 @
be866135
...
@@ -228,8 +228,8 @@ subprojects {
...
@@ -228,8 +228,8 @@ subprojects {
compile
group:
'net.minidev'
,
name:
'json-smart'
,
version:
'2.3'
compile
group:
'net.minidev'
,
name:
'json-smart'
,
version:
'2.3'
compile
group:
'net.minidev'
,
name:
'asm'
,
version:
'1.0.2'
compile
group:
'net.minidev'
,
name:
'asm'
,
version:
'1.0.2'
//oauth third party JustAuth
//oauth third party JustAuth
compile
group:
'com.xkcoding.http'
,
name:
'simple-http'
,
version:
'1.0.
2
'
compile
group:
'com.xkcoding.http'
,
name:
'simple-http'
,
version:
'1.0.
3
'
compile
group:
'me.zhyd.oauth'
,
name:
'JustAuth'
,
version:
'1.15.
7
'
compile
group:
'me.zhyd.oauth'
,
name:
'JustAuth'
,
version:
'1.15.
8
'
//common
//common
compile
group:
'org.javassist'
,
name:
'javassist'
,
version:
'3.23.0-GA'
compile
group:
'org.javassist'
,
name:
'javassist'
,
version:
'3.23.0-GA'
compile
group:
'org.owasp.esapi'
,
name:
'esapi'
,
version:
'2.2.0.0'
compile
group:
'org.owasp.esapi'
,
name:
'esapi'
,
version:
'2.2.0.0'
...
...
maxkey-authentications/src/main/java/org/maxkey/authn/support/socialsignon/SocialSignOnEndpoint.java
浏览文件 @
be866135
...
@@ -98,12 +98,20 @@ public class SocialSignOnEndpoint extends AbstractSocialSignOnEndpoint{
...
@@ -98,12 +98,20 @@ public class SocialSignOnEndpoint extends AbstractSocialSignOnEndpoint{
@RequestMapping
(
value
={
"/callback/{provider}"
},
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
={
"/callback/{provider}"
},
method
=
RequestMethod
.
GET
)
public
ModelAndView
callback
(
@PathVariable
String
provider
public
ModelAndView
callback
(
@PathVariable
String
provider
)
{
)
{
this
.
provider
=
provider
;
this
.
authCallback
();
SocialsAssociate
socialsAssociate
=
null
;
_logger
.
debug
(
this
.
accountId
);
//auth call back may exception
SocialsAssociate
socialSignOnUserToken
=
new
SocialsAssociate
();
try
{
socialSignOnUserToken
.
setProvider
(
provider
);
this
.
provider
=
provider
;
socialSignOnUserToken
.
setSocialuid
(
this
.
accountId
);
this
.
authCallback
();
_logger
.
debug
(
this
.
accountId
);
socialsAssociate
=
new
SocialsAssociate
();
socialsAssociate
.
setProvider
(
provider
);
socialsAssociate
.
setSocialuid
(
this
.
accountId
);
}
catch
(
Exception
e
)
{
_logger
.
error
(
"callback Exception "
,
e
);
}
//for login
//for login
String
socialSignOnType
=
""
;
String
socialSignOnType
=
""
;
...
@@ -112,10 +120,10 @@ public class SocialSignOnEndpoint extends AbstractSocialSignOnEndpoint{
...
@@ -112,10 +120,10 @@ public class SocialSignOnEndpoint extends AbstractSocialSignOnEndpoint{
}
}
if
(
socialSignOnType
.
equals
(
SOCIALSIGNON_TYPE
.
SOCIALSIGNON_TYPE_LOGON
)||
socialSignOnType
.
equals
(
""
)){
if
(
socialSignOnType
.
equals
(
SOCIALSIGNON_TYPE
.
SOCIALSIGNON_TYPE_LOGON
)||
socialSignOnType
.
equals
(
""
)){
socialSignOn
(
social
SignOnUserToken
);
socialSignOn
(
social
sAssociate
);
return
WebContext
.
redirect
(
"/index"
);
return
WebContext
.
redirect
(
"/index"
);
}
else
{
}
else
{
socialBind
(
social
SignOnUserToken
);
socialBind
(
social
sAssociate
);
}
}
if
(
WebContext
.
getAttribute
(
SOCIALSIGNON_SESSION_REDIRECT_URI
)!=
null
){
if
(
WebContext
.
getAttribute
(
SOCIALSIGNON_SESSION_REDIRECT_URI
)!=
null
){
...
@@ -126,38 +134,41 @@ public class SocialSignOnEndpoint extends AbstractSocialSignOnEndpoint{
...
@@ -126,38 +134,41 @@ public class SocialSignOnEndpoint extends AbstractSocialSignOnEndpoint{
}
}
public
boolean
socialBind
(
SocialsAssociate
socialSignOnUserToken
){
public
boolean
socialBind
(
SocialsAssociate
socialsAssociate
){
socialSignOnUserToken
.
setSocialUserInfo
(
accountJsonString
);
if
(
null
==
socialsAssociate
)
{
socialSignOnUserToken
.
setUid
(
WebContext
.
getUserInfo
().
getId
());
return
false
;
socialSignOnUserToken
.
setUsername
(
WebContext
.
getUserInfo
().
getUsername
());
}
//socialSignOnUserToken.setAccessToken(JsonUtils.object2Json(accessToken));
//socialSignOnUserToken.setExAttribute(JsonUtils.object2Json(accessToken.getResponseObject()));
socialsAssociate
.
setSocialUserInfo
(
accountJsonString
);
_logger
.
debug
(
"Social Bind : "
+
socialSignOnUserToken
);
socialsAssociate
.
setUid
(
WebContext
.
getUserInfo
().
getId
());
this
.
socialsAssociateService
.
delete
(
socialSignOnUserToken
);
socialsAssociate
.
setUsername
(
WebContext
.
getUserInfo
().
getUsername
());
this
.
socialsAssociateService
.
insert
(
socialSignOnUserToken
);
//socialsAssociate.setAccessToken(JsonUtils.object2Json(accessToken));
//socialsAssociate.setExAttribute(JsonUtils.object2Json(accessToken.getResponseObject()));
_logger
.
debug
(
"Social Bind : "
+
socialsAssociate
);
this
.
socialsAssociateService
.
delete
(
socialsAssociate
);
this
.
socialsAssociateService
.
insert
(
socialsAssociate
);
return
true
;
return
true
;
}
}
public
boolean
socialSignOn
(
SocialsAssociate
social
SignOnUserToken
){
public
boolean
socialSignOn
(
SocialsAssociate
social
sAssociate
){
socialSignOnUserToken
=
this
.
socialsAssociateService
.
get
(
socialSignOnUserToken
);
socialsAssociate
=
this
.
socialsAssociateService
.
get
(
socialsAssociate
);
_logger
.
debug
(
"callback SocialSignOn User Token : "
+
socialSignOnUserToken
);
_logger
.
debug
(
"Loaded SocialSignOn Socials Associate : "
+
socialsAssociate
);
if
(
null
!=
socialSignOnUserToken
){
if
(
null
==
socialsAssociate
)
{
_logger
.
debug
(
"Social Sign On from "
+
socialSignOnUserToken
.
getProvider
()+
" mapping to user "
+
socialSignOnUserToken
.
getUsername
());
WebContext
.
getRequest
().
getSession
().
setAttribute
(
WebAttributes
.
AUTHENTICATION_EXCEPTION
,
new
BadCredentialsException
(
WebContext
.
getI18nValue
(
"login.error.social"
)));
return
false
;
authenticationProvider
.
trustAuthentication
(
socialSignOnUserToken
.
getUsername
(),
ConstantsLoginType
.
SOCIALSIGNON
,
this
.
socialSignOnProvider
.
getProviderName
(),
"xe00000004"
,
"success"
);
//socialSignOnUserToken.setAccessToken(JsonUtils.object2Json(this.accessToken));
socialSignOnUserToken
.
setSocialUserInfo
(
accountJsonString
);
//socialSignOnUserToken.setExAttribute(JsonUtils.object2Json(accessToken.getResponseObject()));
this
.
socialsAssociateService
.
update
(
socialSignOnUserToken
);
}
else
{
WebContext
.
getRequest
().
getSession
().
setAttribute
(
WebAttributes
.
AUTHENTICATION_EXCEPTION
,
new
BadCredentialsException
(
WebContext
.
getI18nValue
(
"login.error.social"
)));
}
}
_logger
.
debug
(
"Social Sign On from "
+
socialsAssociate
.
getProvider
()+
" mapping to user "
+
socialsAssociate
.
getUsername
());
authenticationProvider
.
trustAuthentication
(
socialsAssociate
.
getUsername
(),
ConstantsLoginType
.
SOCIALSIGNON
,
this
.
socialSignOnProvider
.
getProviderName
(),
"xe00000004"
,
"success"
);
//socialsAssociate.setAccessToken(JsonUtils.object2Json(this.accessToken));
socialsAssociate
.
setSocialUserInfo
(
accountJsonString
);
//socialsAssociate.setExAttribute(JsonUtils.object2Json(accessToken.getResponseObject()));
this
.
socialsAssociateService
.
update
(
socialsAssociate
);
return
true
;
return
true
;
}
}
}
}
maxkey-core/src/main/resources/messages/passwordpolicy_message.properties
浏览文件 @
be866135
...
@@ -32,6 +32,7 @@ PasswordPolicy.OLD_PASSWORD_NOT_MATCH=\u539f\u5bc6\u7801\u4e0d\u5339\u914d.
...
@@ -32,6 +32,7 @@ PasswordPolicy.OLD_PASSWORD_NOT_MATCH=\u539f\u5bc6\u7801\u4e0d\u5339\u914d.
PasswordPolicy.CONFIRMPASSWORD_NOT_MATCH
=
\u
65b0
\u
5bc6
\u7801\u
4e0e
\u
786e
\u
8ba4
\u
5bc6
\u7801\u
4e0d
\u
4e00
\u
81f4.
PasswordPolicy.CONFIRMPASSWORD_NOT_MATCH
=
\u
65b0
\u
5bc6
\u7801\u
4e0e
\u
786e
\u
8ba4
\u
5bc6
\u7801\u
4e0d
\u
4e00
\u
81f4.
PasswordPolicy.OLD_PASSWORD_MATCH
=
\u
65b0
\u
5bc6
\u7801\u
4e0d
\u
80fd
\u
4e0e
\u
65e7
\u
5bc6
\u7801\u
4e00
\u
81f4.
PasswordPolicy.OLD_PASSWORD_MATCH
=
\u
65b0
\u
5bc6
\u7801\u
4e0d
\u
80fd
\u
4e0e
\u
65e7
\u
5bc6
\u7801\u
4e00
\u
81f4.
#\u7528\u6237\u767b\u5f55\u9519\u8bef\u63d0\u9192
login.error.attempts
=
{0}
\u
5c1d
\u
8bd5
\u
767b
\u9646
{1}
\u
6b21
\u6570\u
8fbe
\u5230\u6700\u5927\u9650\u5236\u
ff0c
\u
8bf7
\u
7a0d
\u
540e
\u
518d
\u
767b
\u9646
.
login.error.attempts
=
{0}
\u
5c1d
\u
8bd5
\u
767b
\u9646
{1}
\u
6b21
\u6570\u
8fbe
\u5230\u6700\u5927\u9650\u5236\u
ff0c
\u
8bf7
\u
7a0d
\u
540e
\u
518d
\u
767b
\u9646
.
login.error.locked
=
\u7528\u6237\u
88ab
\u9501\u
5b9a.
login.error.locked
=
\u7528\u6237\u
88ab
\u9501\u
5b9a.
login.error.inactive
=
\u7528\u6237\u
975e
\u
6d3b
\u
52a8
\u
72b6
\u6001
.
login.error.inactive
=
\u7528\u6237\u
975e
\u
6d3b
\u
52a8
\u
72b6
\u6001
.
...
@@ -43,4 +44,5 @@ login.error.password.null=\u5bc6\u7801\u4e0d\u80fd\u4e3a\u7a7a.
...
@@ -43,4 +44,5 @@ login.error.password.null=\u5bc6\u7801\u4e0d\u80fd\u4e3a\u7a7a.
login.error.captcha
=
\u
9a8c
\u
8bc1
\u7801\u9519\u
8bef
\u
ff0c
\u
8bf7
\u
91cd
\u
65b0
\u
767b
\u9646
.
login.error.captcha
=
\u
9a8c
\u
8bc1
\u7801\u9519\u
8bef
\u
ff0c
\u
8bf7
\u
91cd
\u
65b0
\u
767b
\u9646
.
login.error.authtype
=
\u
767b
\u
5f55
\u
8ba4
\u
8bc1
\u
7c7b
\u
578b
\u9519\u
8bef.
login.error.authtype
=
\u
767b
\u
5f55
\u
8ba4
\u
8bc1
\u
7c7b
\u
578b
\u9519\u
8bef.
login.error.session
=
\u
767b
\u
5f55
\u
4f1a
\u
8bdd
\u5931\u6548\u
ff0c
\u
8bf7
\u
91cd
\u
65b0
\u
767b
\u9646
.
login.error.session
=
\u
767b
\u
5f55
\u
4f1a
\u
8bdd
\u5931\u6548\u
ff0c
\u
8bf7
\u
91cd
\u
65b0
\u
767b
\u9646
.
login.error.social
=
\u
793e
\u
4ea4
\u
8d26
\u
53f7
\u6388\u6743\u5931\u
8d25
\u
ff0c
\u
8bf7
\u
91cd
\u
8bd5.
maxkey-core/src/main/resources/messages/passwordpolicy_message_en.properties
浏览文件 @
be866135
...
@@ -32,6 +32,7 @@ PasswordPolicy.OLD_PASSWORD_NOT_MATCH=old password not match.
...
@@ -32,6 +32,7 @@ PasswordPolicy.OLD_PASSWORD_NOT_MATCH=old password not match.
PasswordPolicy.CONFIRMPASSWORD_NOT_MATCH
=
new password not match confirm password.
PasswordPolicy.CONFIRMPASSWORD_NOT_MATCH
=
new password not match confirm password.
PasswordPolicy.OLD_PASSWORD_MATCH
=
new password match old password.
PasswordPolicy.OLD_PASSWORD_MATCH
=
new password match old password.
#for user login
login.error.attempts
=
{0} login attempts the maximum number of {1} times, please login later.
login.error.attempts
=
{0} login attempts the maximum number of {1} times, please login later.
login.error.locked
=
The user is locked.
login.error.locked
=
The user is locked.
login.error.inactive
=
User inactive state.
login.error.inactive
=
User inactive state.
...
@@ -42,4 +43,5 @@ login.error.email.null=email cannot be empty.
...
@@ -42,4 +43,5 @@ login.error.email.null=email cannot be empty.
login.error.password.null
=
Password cannot be empty.
login.error.password.null
=
Password cannot be empty.
login.error.captcha
=
Verification code error, please login again.
login.error.captcha
=
Verification code error, please login again.
login.error.authtype
=
Login authentication type error.
login.error.authtype
=
Login authentication type error.
login.error.session
=
Login session failed. Please login again.
login.error.session
=
Login session failed. please login again.
\ No newline at end of file
login.error.social
=
Social login failed. please retry.
\ No newline at end of file
maxkey-core/src/main/resources/messages/passwordpolicy_message_zh_CN.properties
浏览文件 @
be866135
...
@@ -32,6 +32,7 @@ PasswordPolicy.OLD_PASSWORD_NOT_MATCH=\u539f\u5bc6\u7801\u4e0d\u5339\u914d.
...
@@ -32,6 +32,7 @@ PasswordPolicy.OLD_PASSWORD_NOT_MATCH=\u539f\u5bc6\u7801\u4e0d\u5339\u914d.
PasswordPolicy.CONFIRMPASSWORD_NOT_MATCH
=
\u
65b0
\u
5bc6
\u7801\u
4e0e
\u
786e
\u
8ba4
\u
5bc6
\u7801\u
4e0d
\u
4e00
\u
81f4.
PasswordPolicy.CONFIRMPASSWORD_NOT_MATCH
=
\u
65b0
\u
5bc6
\u7801\u
4e0e
\u
786e
\u
8ba4
\u
5bc6
\u7801\u
4e0d
\u
4e00
\u
81f4.
PasswordPolicy.OLD_PASSWORD_MATCH
=
\u
65b0
\u
5bc6
\u7801\u
4e0d
\u
80fd
\u
4e0e
\u
65e7
\u
5bc6
\u7801\u
4e00
\u
81f4.
PasswordPolicy.OLD_PASSWORD_MATCH
=
\u
65b0
\u
5bc6
\u7801\u
4e0d
\u
80fd
\u
4e0e
\u
65e7
\u
5bc6
\u7801\u
4e00
\u
81f4.
#\u7528\u6237\u767b\u5f55\u9519\u8bef\u63d0\u9192
login.error.attempts
=
{0}
\u
5c1d
\u
8bd5
\u
767b
\u9646
{1}
\u
6b21
\u6570\u
8fbe
\u5230\u6700\u5927\u9650\u5236\u
ff0c
\u
8bf7
\u
7a0d
\u
540e
\u
518d
\u
767b
\u9646
.
login.error.attempts
=
{0}
\u
5c1d
\u
8bd5
\u
767b
\u9646
{1}
\u
6b21
\u6570\u
8fbe
\u5230\u6700\u5927\u9650\u5236\u
ff0c
\u
8bf7
\u
7a0d
\u
540e
\u
518d
\u
767b
\u9646
.
login.error.locked
=
\u7528\u6237\u
88ab
\u9501\u
5b9a.
login.error.locked
=
\u7528\u6237\u
88ab
\u9501\u
5b9a.
login.error.inactive
=
\u7528\u6237\u
975e
\u
6d3b
\u
52a8
\u
72b6
\u6001
.
login.error.inactive
=
\u7528\u6237\u
975e
\u
6d3b
\u
52a8
\u
72b6
\u6001
.
...
@@ -42,4 +43,5 @@ login.error.email.null=\u767b\u5f55\u90ae\u7bb1\u4e0d\u80fd\u4e3a\u7a7a.
...
@@ -42,4 +43,5 @@ login.error.email.null=\u767b\u5f55\u90ae\u7bb1\u4e0d\u80fd\u4e3a\u7a7a.
login.error.password.null
=
\u
5bc6
\u7801\u
4e0d
\u
80fd
\u
4e3a
\u
7a7a.
login.error.password.null
=
\u
5bc6
\u7801\u
4e0d
\u
80fd
\u
4e3a
\u
7a7a.
login.error.captcha
=
\u
9a8c
\u
8bc1
\u7801\u9519\u
8bef
\u
ff0c
\u
8bf7
\u
91cd
\u
65b0
\u
767b
\u9646
.
login.error.captcha
=
\u
9a8c
\u
8bc1
\u7801\u9519\u
8bef
\u
ff0c
\u
8bf7
\u
91cd
\u
65b0
\u
767b
\u9646
.
login.error.authtype
=
\u
767b
\u
5f55
\u
8ba4
\u
8bc1
\u
7c7b
\u
578b
\u9519\u
8bef.
login.error.authtype
=
\u
767b
\u
5f55
\u
8ba4
\u
8bc1
\u
7c7b
\u
578b
\u9519\u
8bef.
login.error.session
=
\u
767b
\u
5f55
\u
4f1a
\u
8bdd
\u5931\u6548\u
ff0c
\u
8bf7
\u
91cd
\u
65b0
\u
767b
\u9646
.
login.error.session
=
\u
767b
\u
5f55
\u
4f1a
\u
8bdd
\u5931\u6548\u
ff0c
\u
8bf7
\u
91cd
\u
65b0
\u
767b
\u9646
.
\ No newline at end of file
login.error.social
=
\u
793e
\u
4ea4
\u
8d26
\u
53f7
\u6388\u6743\u5931\u
8d25
\u
ff0c
\u
8bf7
\u
91cd
\u
8bd5.
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录