Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MaxKey单点登录官方(MaxKeyTop)
MaxKey
提交
e1d00916
MaxKey
项目概览
MaxKey单点登录官方(MaxKeyTop)
/
MaxKey
12 个月 前同步成功
通知
76
Star
3
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
MaxKey
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e1d00916
编写于
1月 11, 2021
作者:
MaxKey单点登录官方
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
SocialsAssociate
上级
1e76c267
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
92 addition
and
13 deletion
+92
-13
maxkey-authentications/src/main/java/org/maxkey/authn/support/socialsignon/service/JdbcSocialsAssociateService.java
...ort/socialsignon/service/JdbcSocialsAssociateService.java
+4
-2
maxkey-authentications/src/main/java/org/maxkey/authn/support/socialsignon/service/SocialSignOnProvider.java
...hn/support/socialsignon/service/SocialSignOnProvider.java
+34
-3
maxkey-authentications/src/main/java/org/maxkey/authn/support/socialsignon/service/SocialsAssociate.java
.../authn/support/socialsignon/service/SocialsAssociate.java
+44
-7
maxkey-web-maxkey/src/main/java/org/maxkey/web/contorller/SocialSignOnListController.java
...org/maxkey/web/contorller/SocialSignOnListController.java
+2
-0
maxkey-web-maxkey/src/main/resources/messages/message.properties
...web-maxkey/src/main/resources/messages/message.properties
+1
-0
maxkey-web-maxkey/src/main/resources/messages/message_en.properties
...-maxkey/src/main/resources/messages/message_en.properties
+1
-0
maxkey-web-maxkey/src/main/resources/messages/message_zh_CN.properties
...xkey/src/main/resources/messages/message_zh_CN.properties
+1
-0
maxkey-web-maxkey/src/main/resources/templates/views/social/socialSignOnProvider.ftl
...resources/templates/views/social/socialSignOnProvider.ftl
+5
-1
未找到文件。
maxkey-authentications/src/main/java/org/maxkey/authn/support/socialsignon/service/JdbcSocialsAssociateService.java
浏览文件 @
e1d00916
...
...
@@ -33,9 +33,9 @@ public class JdbcSocialsAssociateService implements SocialsAssociateService{
private
static
final
String
DEFAULT_DEFAULT_INSERT_STATEMENT
=
"INSERT INTO MXK_SOCIALS_ASSOCIATE(ID, UID , USERNAME , PROVIDER , SOCIALUID , ACCESSTOKEN , SOCIALUSERINFO , EXATTRIBUTE )VALUES( ? , ? , ? , ? , ?, ? , ? , ?)"
;
private
static
final
String
DEFAULT_DEFAULT_SIGNON_SELECT_STATEMENT
=
"SELECT ID, UID , USERNAME , PROVIDER , SOCIALUID , ACCESSTOKEN , SOCIALUSERINFO , EXATTRIBUTE FROM MXK_SOCIALS_ASSOCIATE WHERE PROVIDER = ? AND SOCIALUID = ?"
;
private
static
final
String
DEFAULT_DEFAULT_SIGNON_SELECT_STATEMENT
=
"SELECT ID, UID , USERNAME , PROVIDER , SOCIALUID , ACCESSTOKEN , SOCIALUSERINFO , EXATTRIBUTE
, CREATEDDATE , UPDATEDDATE
FROM MXK_SOCIALS_ASSOCIATE WHERE PROVIDER = ? AND SOCIALUID = ?"
;
private
static
final
String
DEFAULT_DEFAULT_BIND_SELECT_STATEMENT
=
"SELECT ID, UID , USERNAME , PROVIDER , SOCIALUID , ACCESSTOKEN , SOCIALUSERINFO , EXATTRIBUTE FROM MXK_SOCIALS_ASSOCIATE WHERE UID = ?"
;
private
static
final
String
DEFAULT_DEFAULT_BIND_SELECT_STATEMENT
=
"SELECT ID, UID , USERNAME , PROVIDER , SOCIALUID , ACCESSTOKEN , SOCIALUSERINFO , EXATTRIBUTE
, CREATEDDATE , UPDATEDDATE
FROM MXK_SOCIALS_ASSOCIATE WHERE UID = ?"
;
private
static
final
String
DEFAULT_DEFAULT_DELETE_STATEMENT
=
"DELETE FROM MXK_SOCIALS_ASSOCIATE WHERE UID = ? AND PROVIDER = ?"
;
...
...
@@ -119,6 +119,8 @@ public class JdbcSocialsAssociateService implements SocialsAssociateService{
socialsAssociate
.
setAccessToken
(
rs
.
getString
(
6
));
socialsAssociate
.
setSocialUserInfo
(
rs
.
getString
(
7
));
socialsAssociate
.
setExAttribute
(
rs
.
getString
(
8
));
socialsAssociate
.
setCreatedDate
(
rs
.
getString
(
9
));
socialsAssociate
.
setUpdatedDate
(
rs
.
getString
(
10
));
return
socialsAssociate
;
}
}
...
...
maxkey-authentications/src/main/java/org/maxkey/authn/support/socialsignon/service/SocialSignOnProvider.java
浏览文件 @
e1d00916
...
...
@@ -31,6 +31,7 @@ public class SocialSignOnProvider {
private
String
accountId
;
private
String
bindTime
;
private
String
unBindTime
;
private
String
lastLoginTime
;
private
int
sortOrder
;
...
...
@@ -125,11 +126,41 @@ public class SocialSignOnProvider {
this
.
unBindTime
=
unBindTime
;
}
public
String
getLastLoginTime
()
{
return
lastLoginTime
;
}
public
void
setLastLoginTime
(
String
lastLoginTime
)
{
this
.
lastLoginTime
=
lastLoginTime
;
}
@Override
public
String
toString
()
{
return
"SocialSignOnProvider [provider="
+
provider
+
", providerName="
+
providerName
+
", icon="
+
icon
+
", clientId="
+
clientId
+
", clientSecret="
+
clientSecret
+
", accountId="
+
accountId
+
", sortOrder="
+
sortOrder
+
", userBind="
+
userBind
+
"]"
;
StringBuilder
builder
=
new
StringBuilder
();
builder
.
append
(
"SocialSignOnProvider [provider="
);
builder
.
append
(
provider
);
builder
.
append
(
", providerName="
);
builder
.
append
(
providerName
);
builder
.
append
(
", icon="
);
builder
.
append
(
icon
);
builder
.
append
(
", clientId="
);
builder
.
append
(
clientId
);
builder
.
append
(
", clientSecret="
);
builder
.
append
(
clientSecret
);
builder
.
append
(
", accountId="
);
builder
.
append
(
accountId
);
builder
.
append
(
", bindTime="
);
builder
.
append
(
bindTime
);
builder
.
append
(
", unBindTime="
);
builder
.
append
(
unBindTime
);
builder
.
append
(
", lastLoginTime="
);
builder
.
append
(
lastLoginTime
);
builder
.
append
(
", sortOrder="
);
builder
.
append
(
sortOrder
);
builder
.
append
(
", userBind="
);
builder
.
append
(
userBind
);
builder
.
append
(
"]"
);
return
builder
.
toString
();
}
...
...
maxkey-authentications/src/main/java/org/maxkey/authn/support/socialsignon/service/SocialsAssociate.java
浏览文件 @
e1d00916
...
...
@@ -37,6 +37,8 @@ public class SocialsAssociate extends JpaBaseDomain {
private
String
socialUserInfo
;
private
String
accessToken
;
private
String
exAttribute
;
private
String
createdDate
;
private
String
updatedDate
;
public
SocialsAssociate
()
{}
...
...
@@ -110,11 +112,46 @@ public class SocialsAssociate extends JpaBaseDomain {
this
.
exAttribute
=
exAttribute
;
}
@Override
public
String
toString
()
{
return
"SocialSignOnUserToken [provider="
+
provider
+
", uid="
+
uid
+
", socialuid="
+
socialuid
+
", socialUserInfo="
+
socialUserInfo
+
", accessToken="
+
accessToken
+
", exAttribute="
+
exAttribute
+
"]"
;
}
public
String
getCreatedDate
()
{
return
createdDate
;
}
public
void
setCreatedDate
(
String
createdDate
)
{
this
.
createdDate
=
createdDate
;
}
public
String
getUpdatedDate
()
{
return
updatedDate
;
}
public
void
setUpdatedDate
(
String
updatedDate
)
{
this
.
updatedDate
=
updatedDate
;
}
@Override
public
String
toString
()
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
append
(
"SocialsAssociate [id="
);
builder
.
append
(
id
);
builder
.
append
(
", provider="
);
builder
.
append
(
provider
);
builder
.
append
(
", uid="
);
builder
.
append
(
uid
);
builder
.
append
(
", username="
);
builder
.
append
(
username
);
builder
.
append
(
", socialuid="
);
builder
.
append
(
socialuid
);
builder
.
append
(
", socialUserInfo="
);
builder
.
append
(
socialUserInfo
);
builder
.
append
(
", accessToken="
);
builder
.
append
(
accessToken
);
builder
.
append
(
", exAttribute="
);
builder
.
append
(
exAttribute
);
builder
.
append
(
", createdDate="
);
builder
.
append
(
createdDate
);
builder
.
append
(
", updatedDate="
);
builder
.
append
(
updatedDate
);
builder
.
append
(
"]"
);
return
builder
.
toString
();
}
}
maxkey-web-maxkey/src/main/java/org/maxkey/web/contorller/SocialSignOnListController.java
浏览文件 @
e1d00916
...
...
@@ -72,6 +72,8 @@ public class SocialSignOnListController {
for
(
SocialsAssociate
ssout
:
listSocialSignOnUserToken
){
if
(
ssout
.
getProvider
().
equals
(
ssop
.
getProvider
())){
socialSignOnProvider
.
setUserBind
(
true
);
socialSignOnProvider
.
setBindTime
(
ssout
.
getCreatedDate
());
socialSignOnProvider
.
setLastLoginTime
(
ssout
.
getUpdatedDate
());
_logger
.
debug
(
"binded provider : "
+
ssout
.
getProvider
());
}
}
...
...
maxkey-web-maxkey/src/main/resources/messages/message.properties
浏览文件 @
e1d00916
...
...
@@ -76,6 +76,7 @@ login.social.icon=\u56fe\u6807
login.social.provider
=
\u
4f9b
\u
5e94
\u5546
login.social.bindtime
=
\u
7ed1
\u
5b9a
\u
65f6
\u
95f4
login.social.unbindtime
=
\u
89e3
\u9664\u
65f6
\u
95f4
login.social.lastLoginTime
=
\u6700\u
8fd1
\u
767b
\u
5f55
\u
65f6
\u
95f4
login.social.action
=
\u
64cd
\u
4f5c
userinfo.displayName
=
\u7528\u6237\u
540d
...
...
maxkey-web-maxkey/src/main/resources/messages/message_en.properties
浏览文件 @
e1d00916
...
...
@@ -75,6 +75,7 @@ login.social.icon=Icon
login.social.provider
=
Provider
login.social.bindtime
=
BindTime
login.social.unbindtime
=
unBindTime
login.social.lastLoginTime
=
LastLoginTime
login.social.action
=
Action
userinfo.displayName
=
displayName
...
...
maxkey-web-maxkey/src/main/resources/messages/message_zh_CN.properties
浏览文件 @
e1d00916
...
...
@@ -76,6 +76,7 @@ login.social.icon=\u56fe\u6807
login.social.provider
=
\u
4f9b
\u
5e94
\u5546
login.social.bindtime
=
\u
7ed1
\u
5b9a
\u
65f6
\u
95f4
login.social.unbindtime
=
\u
89e3
\u9664\u
65f6
\u
95f4
login.social.lastLoginTime
=
\u6700\u
8fd1
\u
767b
\u
5f55
\u
65f6
\u
95f4
login.social.action
=
\u
64cd
\u
4f5c
userinfo.displayName
=
\u7528\u6237\u
540d
...
...
maxkey-web-maxkey/src/main/resources/templates/views/social/socialSignOnProvider.ftl
浏览文件 @
e1d00916
...
...
@@ -14,6 +14,8 @@
<th><
@
locale
code=
"login.social.sortorder"
/></th>
<th><
@
locale
code=
"login.social.icon"
/></th>
<th><
@
locale
code=
"login.social.provider"
/></th>
<th><
@
locale
code=
"login.social.bindtime"
/></th>
<th><
@
locale
code=
"login.social.lastLoginTime"
/></th>
<th><
@
locale
code=
"login.social.action"
/></th>
</tr>
</thead>
...
...
@@ -22,7 +24,9 @@
<tr>
<td>
${socialSignOnProvider.sortOrder}
</td>
<td><img
src=
"<@base />/static/${socialSignOnProvider.icon}"
title=
"${socialSignOnProvider.providerName}"
width=
"32px;"
height=
"32px;"
/></td>
<td>
${socialSignOnProvider.providerName}
</td>
<td>
${socialSignOnProvider.providerName}
</td>
<td>
${socialSignOnProvider.bindTime!}
</td>
<td>
${socialSignOnProvider.lastLoginTime!}
</td>
<td>
<
#if
false=
=socialSignOnProvider.userBind
>
<a
href=
"<@base/>/logon/oauth20/bind/${socialSignOnProvider.provider}"
><
@
locale
code=
"login.social.link"
/></a>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录