Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MaxKey单点登录官方(MaxKeyTop)
MaxKey
提交
7315252c
MaxKey
项目概览
MaxKey单点登录官方(MaxKeyTop)
/
MaxKey
9 个月 前同步成功
通知
75
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,体验更适合开发者的 AI 搜索 >>
提交
7315252c
编写于
8月 02, 2021
作者:
M
MaxKey
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
socialSignOn
上级
ad2dbb1c
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
69 addition
and
60 deletion
+69
-60
maxkey-authentications/maxkey-authentication-social/src/main/java/org/maxkey/authn/support/socialsignon/AbstractSocialSignOnEndpoint.java
...hn/support/socialsignon/AbstractSocialSignOnEndpoint.java
+14
-11
maxkey-authentications/maxkey-authentication-social/src/main/java/org/maxkey/authn/support/socialsignon/SocialSignOnEndpoint.java
...xkey/authn/support/socialsignon/SocialSignOnEndpoint.java
+26
-28
maxkey-authentications/maxkey-authentication-social/src/main/java/org/maxkey/authn/support/socialsignon/service/SocialSignOnProviderService.java
...ort/socialsignon/service/SocialSignOnProviderService.java
+2
-3
maxkey-webs/maxkey-web-mgt/src/main/resources/messages/message.properties
...ey-web-mgt/src/main/resources/messages/message.properties
+7
-6
maxkey-webs/maxkey-web-mgt/src/main/resources/messages/message_en.properties
...web-mgt/src/main/resources/messages/message_en.properties
+3
-3
maxkey-webs/maxkey-web-mgt/src/main/resources/messages/message_zh_CN.properties
...-mgt/src/main/resources/messages/message_zh_CN.properties
+9
-8
maxkey-webs/maxkey-web-mgt/src/main/resources/templates/views/synchronizers/synchronizerUpdate.ftl
...rces/templates/views/synchronizers/synchronizerUpdate.ftl
+8
-1
未找到文件。
maxkey-authentications/maxkey-authentication-social/src/main/java/org/maxkey/authn/support/socialsignon/AbstractSocialSignOnEndpoint.java
浏览文件 @
7315252c
...
...
@@ -83,20 +83,23 @@ public class AbstractSocialSignOnEndpoint {
ApplicationConfig
applicationConfig
;
protected
AuthRequest
buildAuthRequest
(
String
provider
){
SocialSignOnProvider
socialSignOnProvider
=
socialSignOnProviderService
.
get
(
provider
);
_logger
.
debug
(
"socialSignOn Provider : "
+
socialSignOnProvider
);
if
(
socialSignOnProvider
!=
null
){
authRequest
=
socialSignOnProviderService
.
getAuthRequest
(
provider
,
applicationConfig
);
WebContext
.
setAttribute
(
SOCIALSIGNON_OAUTH_SERVICE_SESSION
,
authRequest
);
WebContext
.
setAttribute
(
SOCIALSIGNON_PROVIDER_SESSION
,
socialSignOnProvider
);
return
authRequest
;
}
try
{
SocialSignOnProvider
socialSignOnProvider
=
socialSignOnProviderService
.
get
(
provider
);
_logger
.
debug
(
"socialSignOn Provider : "
+
socialSignOnProvider
);
if
(
socialSignOnProvider
!=
null
){
authRequest
=
socialSignOnProviderService
.
getAuthRequest
(
provider
,
applicationConfig
);
WebContext
.
setAttribute
(
SOCIALSIGNON_OAUTH_SERVICE_SESSION
,
authRequest
);
WebContext
.
setAttribute
(
SOCIALSIGNON_PROVIDER_SESSION
,
socialSignOnProvider
);
return
authRequest
;
}
}
catch
(
Exception
e
)
{
_logger
.
debug
(
"buildAuthRequest Exception "
,
e
);
}
return
null
;
}
protected
String
authCallback
()
{
protected
String
authCallback
()
throws
Exception
{
authRequest
=(
AuthRequest
)
WebContext
.
getAttribute
(
SOCIALSIGNON_OAUTH_SERVICE_SESSION
);
socialSignOnProvider
=(
SocialSignOnProvider
)
WebContext
.
getAttribute
(
SOCIALSIGNON_PROVIDER_SESSION
);
WebContext
.
removeAttribute
(
SOCIALSIGNON_OAUTH_SERVICE_SESSION
);
...
...
maxkey-authentications/maxkey-authentication-social/src/main/java/org/maxkey/authn/support/socialsignon/SocialSignOnEndpoint.java
浏览文件 @
7315252c
...
...
@@ -24,7 +24,6 @@ import javax.servlet.http.HttpServletRequest;
import
org.maxkey.authn.support.socialsignon.service.SocialSignOnProvider
;
import
org.maxkey.authn.support.socialsignon.service.SocialsAssociate
;
import
org.maxkey.configuration.ApplicationConfig
;
import
org.maxkey.constants.ConstantsLoginType
;
import
org.maxkey.web.WebContext
;
import
org.slf4j.Logger
;
...
...
@@ -48,9 +47,9 @@ public class SocialSignOnEndpoint extends AbstractSocialSignOnEndpoint{
final
static
Logger
_logger
=
LoggerFactory
.
getLogger
(
SocialSignOnEndpoint
.
class
);
public
ModelAndView
socialSignOnAuthorize
(
HttpServletRequest
request
,
String
provider
){
_logger
.
debug
(
"SocialSignOn provider : "
+
provider
);
_logger
.
trace
(
"SocialSignOn provider : "
+
provider
);
String
authorizationUrl
=
buildAuthRequest
(
provider
).
authorize
(
request
.
getSession
().
getId
());
_logger
.
debug
(
"authorize SocialSignOn : "
+
authorizationUrl
);
_logger
.
trace
(
"authorize SocialSignOn : "
+
authorizationUrl
);
return
WebContext
.
redirect
(
authorizationUrl
);
}
...
...
@@ -111,12 +110,10 @@ public class SocialSignOnEndpoint extends AbstractSocialSignOnEndpoint{
@RequestMapping
(
value
={
"/callback/{provider}"
},
method
=
RequestMethod
.
GET
)
public
ModelAndView
callback
(
@PathVariable
String
provider
)
{
SocialsAssociate
socialsAssociate
=
null
;
//auth call back may exception
public
ModelAndView
callback
(
@PathVariable
String
provider
)
{
//auth call back may exception
try
{
SocialsAssociate
socialsAssociate
=
null
;
this
.
provider
=
provider
;
this
.
authCallback
();
_logger
.
debug
(
this
.
accountId
);
...
...
@@ -124,29 +121,30 @@ public class SocialSignOnEndpoint extends AbstractSocialSignOnEndpoint{
socialsAssociate
.
setProvider
(
provider
);
socialsAssociate
.
setSocialuid
(
this
.
accountId
);
//for login
String
socialSignOnType
=
""
;
if
(
WebContext
.
getAttribute
(
SOCIALSIGNON_TYPE_SESSION
)!=
null
){
socialSignOnType
=
WebContext
.
getAttribute
(
SOCIALSIGNON_TYPE_SESSION
).
toString
();
}
if
(
socialSignOnType
.
equals
(
SOCIALSIGNON_TYPE
.
SOCIALSIGNON_TYPE_LOGON
)||
socialSignOnType
.
equals
(
""
)){
socialSignOn
(
socialsAssociate
);
return
WebContext
.
redirect
(
"/index"
);
}
else
{
socialBind
(
socialsAssociate
);
}
if
(
WebContext
.
getAttribute
(
SOCIALSIGNON_SESSION_REDIRECT_URI
)!=
null
){
return
WebContext
.
redirect
(
WebContext
.
getAttribute
(
SOCIALSIGNON_SESSION_REDIRECT_URI
).
toString
());
}
else
{
return
WebContext
.
forward
(
"/socialsignon/list"
);
}
}
catch
(
Exception
e
)
{
_logger
.
error
(
"callback Exception "
,
e
);
}
//for login
String
socialSignOnType
=
""
;
if
(
WebContext
.
getAttribute
(
SOCIALSIGNON_TYPE_SESSION
)!=
null
){
socialSignOnType
=
WebContext
.
getAttribute
(
SOCIALSIGNON_TYPE_SESSION
).
toString
();
}
if
(
socialSignOnType
.
equals
(
SOCIALSIGNON_TYPE
.
SOCIALSIGNON_TYPE_LOGON
)||
socialSignOnType
.
equals
(
""
)){
socialSignOn
(
socialsAssociate
);
return
WebContext
.
redirect
(
"/index"
);
}
else
{
socialBind
(
socialsAssociate
);
}
if
(
WebContext
.
getAttribute
(
SOCIALSIGNON_SESSION_REDIRECT_URI
)!=
null
){
return
WebContext
.
redirect
(
WebContext
.
getAttribute
(
SOCIALSIGNON_SESSION_REDIRECT_URI
).
toString
());
}
else
{
return
WebContext
.
forward
(
"/socialsignon/list"
);
}
return
WebContext
.
redirect
(
"/login"
);
}
public
boolean
socialBind
(
SocialsAssociate
socialsAssociate
){
...
...
maxkey-authentications/maxkey-authentication-social/src/main/java/org/maxkey/authn/support/socialsignon/service/SocialSignOnProviderService.java
浏览文件 @
7315252c
...
...
@@ -21,7 +21,6 @@ import java.util.HashMap;
import
java.util.List
;
import
org.maxkey.configuration.ApplicationConfig
;
import
org.maxkey.web.WebContext
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -44,7 +43,7 @@ public class SocialSignOnProviderService{
return
socialSignOnProviderMaps
.
get
(
provider
);
}
public
AuthRequest
getAuthRequest
(
String
provider
,
ApplicationConfig
applicationConfig
)
{
public
AuthRequest
getAuthRequest
(
String
provider
,
ApplicationConfig
applicationConfig
)
throws
Exception
{
AuthRequest
authRequest
=
null
;
AuthConfig
authConfig
=
AuthConfig
.
builder
()
.
clientId
(
this
.
get
(
provider
).
getClientId
())
...
...
@@ -107,7 +106,7 @@ public class SocialSignOnProviderService{
return
authRequest
;
}
public
String
getAccountId
(
String
provider
,
AuthResponse
<?>
authResponse
)
{
public
String
getAccountId
(
String
provider
,
AuthResponse
<?>
authResponse
)
throws
Exception
{
if
(
provider
.
equalsIgnoreCase
(
"WeChatOpen"
))
{
return
((
AuthUser
)
authResponse
.
getData
()).
getUuid
();
}
else
if
(
provider
.
equalsIgnoreCase
(
"sinaweibo"
))
{
...
...
maxkey-webs/maxkey-web-mgt/src/main/resources/messages/message.properties
浏览文件 @
7315252c
global.title
=
MaxKey
\u
8eab
\u
4efd
\u
5b89
\u5168\u
7ba1
\u7406\u
7cfb
\u
7edf
global.application
=
Max<span style="color: #FFD700;">Key</span>
\u
8eab
\u
4efd
\u
5b89
\u5168\u
7ba1
\u7406\u
7cfb
\u
7edf
global.title
=
Genvict
\u
8eab
\u
4efd
\u
5b89
\u5168\u
7ba1
\u7406\u
7cfb
\u
7edf
global.application
=
Genvict
\u
8eab
\u
4efd
\u
5b89
\u5168\u
7ba1
\u7406\u
7cfb
\u
7edf
global.change.language
=
\u
8bed
\u
8a00
\u9009\u
62e9
global.change.language.en
=
English
global.change.language.zh
=
\u
4e2d
\u6587
...
...
@@ -462,6 +462,7 @@ synchronizers.trustStore=\u8BC1\u4E66\u8DEF\u5F84
synchronizers.trustStorePassword
=
\u
8BC1
\u
4E66
\u
5BC6
\u
94A5
synchronizers.resumeTime
=
\u6062\u
590D
\u
65F6
\u
95F4
synchronizers.suspendTime
=
\u6302\u
8D77
\u
65F6
\u
95F4
synchronizers.syncStartTime
=
\u
533A
\u
95F4
#button
button.text.action
=
\u
8bbf
\u
95ee
button.text.visit
=
\u
8bbf
\u
95ee
...
...
@@ -525,7 +526,7 @@ log.synchronizer.objectType=\u5BF9\u8C61\u540D\u79F0
log.synchronizer.objectName
=
\u
5BF9
\u
8C61
\u
540D
\u
79F0
log.synchronizer.syncTime
=
\u
540C
\u
6B65
\u
65F6
\u
95F4
log.synchronizer.result
=
\u
7ED3
\u
679C
#connector
log.connector.id
=
\u
7F16
\u
53F7
log.connector.conName
=
\u
8FDE
\u
63A5
\u5668
log.connector.conType
=
\u
7C7B
\u
578B
...
...
@@ -537,7 +538,6 @@ log.connector.description=\u63CF\u8FF0
log.connector.syncTime
=
\u
65F6
\u
95F4
log.connector.result
=
\u
7ED3
\u
679C
#message
message.action.insert.success
=
\u
65b0
\u
589e
\u
64cd
\u
4f5c
\u6210\u
529f
message.action.insert.error
=
\u
65b0
\u
589e
\u
64cd
\u
4f5c
\u5931\u
8d25
message.action.update.success
=
\u
66f4
\u
65b0
\u
64cd
\u
4f5c
\u6210\u
529f
...
...
@@ -546,16 +546,17 @@ message.action.delete.success=\u5220\u9664\u64cd\u4f5c\u6210\u529f
message.action.delete.error
=
\u5220\u9664\u
64cd
\u
4f5c
\u5931\u
8d25
message.action.import.success
=
\u6279\u
91cf
\u
5bfc
\u5165\u6210\u
529f
message.action.import.error
=
\u6279\u
91cf
\u
5bfc
\u5165\u5931\u
8d25
#import
import.title
=
\u6279\u
91cf
\u
5bfc
\u5165\u6570\u
636e
import.file.select
=
\u9009\u
62e9
\u
5bfc
\u5165\u6587\u
4ef6
import.template.download
=
\u
4e0b
\u
8f7d
\u
6a21
\u
677f
import.update.exist
=
\u
66f4
\u
65b0
\u
5b58
\u5728\u6570\u
636e
import.tip
=
\u
63d0
\u
793a
\u
ff1a
\u
4ec5
\u5141\u
8bb8
\u
5bfc
\u5165\u
201cxls
\u
201d
\u6216\u8005\u
201cxlsx
\u
201d
\u
683c
\u
5f0f
\u7684\u6587\u
4ef6
#Notices
notices.title
=
\u6807\u9898
notices.content
=
\u5185\u
5BB9
#navs
navs.system
=
\u
7cfb
\u
7edf
navs.home
=
\u9996\u9875
navs.orgs
=
\u
673a
\u6784\u
7ba1
\u7406
...
...
maxkey-webs/maxkey-web-mgt/src/main/resources/messages/message_en.properties
浏览文件 @
7315252c
global.title
=
MaxKey
Secure Management
global.application
=
Max<span style="color: #FFD700;">Key</span>
Secure Management
global.title
=
Genvict
Secure Management
global.application
=
Secure Management
global.change.language
=
Language
global.change.language.en
=
English
global.change.language.zh
=
\u
4e2d
\u6587
...
...
@@ -473,6 +473,7 @@ synchronizers.trustStore=trustStore
synchronizers.trustStorePassword
=
trustStorePassword
synchronizers.resumeTime
=
resumeTime
synchronizers.suspendTime
=
suspendTime
synchronizers.syncStartTime
=
During
button.text.action
=
Action
...
...
@@ -538,7 +539,6 @@ log.synchronizer.objectName=ObjectName
log.synchronizer.syncTime
=
SyncTime
log.synchronizer.result
=
Result
log.connector.id
=
Id
log.connector.conName
=
Connector
log.connector.conType
=
Type
...
...
maxkey-webs/maxkey-web-mgt/src/main/resources/messages/message_zh_CN.properties
浏览文件 @
7315252c
global.title
=
MaxKey
\u
8eab
\u
4efd
\u
5b89
\u5168\u
7ba1
\u7406\u
7cfb
\u
7edf
global.application
=
Max<span style="color: #FFD700;">Key</span>
\u
8eab
\u
4efd
\u
5b89
\u5168\u
7ba1
\u7406\u
7cfb
\u
7edf
global.title
=
Genvict
\u
8eab
\u
4efd
\u
5b89
\u5168\u
7ba1
\u7406\u
7cfb
\u
7edf
global.application
=
\u
8eab
\u
4efd
\u
5b89
\u5168\u
7ba1
\u7406\u
7cfb
\u
7edf
global.change.language
=
\u
8bed
\u
8a00
\u9009\u
62e9
global.change.language.en
=
English
global.change.language.zh
=
\u
4e2d
\u6587
...
...
@@ -468,7 +468,8 @@ synchronizers.trustStore=\u8BC1\u4E66\u8DEF\u5F84
synchronizers.trustStorePassword
=
\u
8BC1
\u
4E66
\u
5BC6
\u
94A5
synchronizers.resumeTime
=
\u6062\u
590D
\u
65F6
\u
95F4
synchronizers.suspendTime
=
\u6302\u
8D77
\u
65F6
\u
95F4
#button
synchronizers.syncStartTime
=
\u
533A
\u
95F4
button.text.action
=
\u
8bbf
\u
95ee
button.text.visit
=
\u
8bbf
\u
95ee
button.text.save
=
\u
4fdd
\u
5b58
...
...
@@ -489,7 +490,7 @@ button.text.hidden=\u9690\u85cf
button.text.import
=
\u
5bfc
\u5165
button.text.adjunct
=
\u
517c
\u
4efb
\u
673a
\u6784
button.text.sync
=
\u
540C
\u
6B65
#
history login
#
loginhistory
log.loginhistory.id
=
\u
7f16
\u
53f7
log.loginhistory.sessionId
=
\u
4f1a
\u
8bdd
log.loginhistory.username
=
\u
767b
\u
5f55
\u
540d
...
...
@@ -506,7 +507,7 @@ log.loginhistory.application=\u5e94\u7528
log.loginhistory.loginUrl
=
\u
767b
\u
5f55
\u5730\u5740
log.loginhistory.code
=
\u
4ee3
\u7801
log.loginhistory.rpUserInfo
=
\u
7b2c
\u
4e09
\u
65b9
#
history login apps
#
loginappshistory
log.loginappshistory.id
=
\u
7f16
\u
53f7
log.loginappshistory.sessionId
=
\u
4f1a
\u
8bdd
log.loginappshistory.uid
=
\u7528\u6237\u
7f16
\u
53f7
...
...
@@ -515,14 +516,14 @@ log.loginappshistory.displayName=\u7528\u6237\u540d
log.loginappshistory.appId
=
\u
5e94
\u7528\u
7f16
\u
53f7
log.loginappshistory.appName
=
\u
5e94
\u7528\u
540d
\u
79f0
log.loginappshistory.loginTime
=
\u
767b
\u
5f55
\u
65f6
\u
95f4
#
history
operate
#operate
log.operate.servicename
=
\u
670d
\u
52a1
log.operate.message
=
\u
6d88
\u
606f
log.operate.content
=
\u5185\u
5bb9
log.operate.messageType
=
\u
6d88
\u
606f
\u
7c7b
\u
578b
log.operate.operateType
=
\u
64cd
\u
4f5c
\u
7c7b
\u
578b
log.operate.username
=
\u
64cd
\u
4f5c
\u
4eba
#
history
synchronizer
#synchronizer
log.synchronizer.id
=
\u
7F16
\u
53F7
log.synchronizer.syncId
=
\u
540C
\u
6B65
\u5668\u
7F16
\u
53F7
log.synchronizer.syncName
=
\u
540C
\u
6B65
\u5668
...
...
@@ -531,7 +532,7 @@ log.synchronizer.objectType=\u5BF9\u8C61\u540D\u79F0
log.synchronizer.objectName
=
\u
5BF9
\u
8C61
\u
540D
\u
79F0
log.synchronizer.syncTime
=
\u
540C
\u
6B65
\u
65F6
\u
95F4
log.synchronizer.result
=
\u
7ED3
\u
679C
#
history
connector
#connector
log.connector.id
=
\u
7F16
\u
53F7
log.connector.conName
=
\u
8FDE
\u
63A5
\u5668
log.connector.conType
=
\u
7C7B
\u
578B
...
...
maxkey-webs/maxkey-web-mgt/src/main/resources/templates/views/synchronizers/synchronizerUpdate.ftl
浏览文件 @
7315252c
...
...
@@ -39,7 +39,7 @@
<input
type=
"text"
id=
"scheduler"
name=
"scheduler"
class=
"form-control"
title=
""
value=
"${model.scheduler!}"
/>
</td>
</tr>
<
#if
"
DINGDING
"==
model.sourceType
||
"
WORKWEIXIN
"=
=
model.sourceType
>
<
#if
"
LDAP
"!=
model.sourceType
&&
"
MSAD
"!=
model.sourceType
&&
"
JDBC
"!
=
model.sourceType
>
<tr>
<th><
@
locale
code=
"synchronizers.principal"
/>
:
</th>
<td
nowrap
>
...
...
@@ -141,6 +141,13 @@
</td>
</tr>
</
#
if>
<tr>
<th><
@
locale
code=
"synchronizers.syncStartTime"
/>
:
</th>
<td
nowrap
>
<input
type=
"text"
id=
"syncStartTime"
name=
"syncStartTime"
class=
"form-control"
title=
""
value=
"${model.syncStartTime!}"
/>
</td>
</tr>
<tr>
<th><
@
locale
code=
"synchronizers.resumeTime"
/>
:
</th>
<td
nowrap
>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录