Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
yujianwangzivayy
MaxKey
提交
2fe1f9f6
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,发现更多精彩内容 >>
提交
2fe1f9f6
编写于
2月 19, 2022
作者:
M
MaxKey
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ldap Context accountMapping
上级
ee8b7536
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
68 addition
and
8 deletion
+68
-8
maxkey-authentications/maxkey-authentication-core/src/main/java/org/maxkey/authn/realm/IAuthenticationServer.java
...in/java/org/maxkey/authn/realm/IAuthenticationServer.java
+2
-1
maxkey-authentications/maxkey-authentication-core/src/main/java/org/maxkey/authn/realm/ldap/ActiveDirectoryServer.java
...va/org/maxkey/authn/realm/ldap/ActiveDirectoryServer.java
+9
-0
maxkey-authentications/maxkey-authentication-core/src/main/java/org/maxkey/authn/realm/ldap/LdapAuthenticationRealm.java
.../org/maxkey/authn/realm/ldap/LdapAuthenticationRealm.java
+6
-2
maxkey-authentications/maxkey-authentication-core/src/main/java/org/maxkey/authn/realm/ldap/LdapAuthenticationRealmService.java
...xkey/authn/realm/ldap/LdapAuthenticationRealmService.java
+6
-0
maxkey-authentications/maxkey-authentication-core/src/main/java/org/maxkey/authn/realm/ldap/StandardLdapServer.java
.../java/org/maxkey/authn/realm/ldap/StandardLdapServer.java
+10
-0
maxkey-core/src/main/java/org/maxkey/entity/LdapContext.java
maxkey-core/src/main/java/org/maxkey/entity/LdapContext.java
+10
-0
maxkey-core/src/main/java/org/maxkey/web/MetadataEndpoint.java
...y-core/src/main/java/org/maxkey/web/MetadataEndpoint.java
+2
-2
maxkey-webs/maxkey-web-mgt/src/main/resources/messages/message.properties
...ey-web-mgt/src/main/resources/messages/message.properties
+1
-0
maxkey-webs/maxkey-web-mgt/src/main/resources/messages/message_en.properties
...web-mgt/src/main/resources/messages/message_en.properties
+1
-0
maxkey-webs/maxkey-web-mgt/src/main/resources/messages/message_zh_CN.properties
...-mgt/src/main/resources/messages/message_zh_CN.properties
+1
-0
maxkey-webs/maxkey-web-mgt/src/main/resources/templates/views/ldapcontext/updateLdapContext.ftl
...sources/templates/views/ldapcontext/updateLdapContext.ftl
+20
-3
未找到文件。
maxkey-authentications/maxkey-authentication-core/src/main/java/org/maxkey/authn/realm/IAuthenticationServer.java
浏览文件 @
2fe1f9f6
...
...
@@ -25,5 +25,6 @@ package org.maxkey.authn.realm;
public
interface
IAuthenticationServer
{
public
boolean
authenticate
(
String
username
,
String
password
);
public
boolean
isMapping
();
}
maxkey-authentications/maxkey-authentication-core/src/main/java/org/maxkey/authn/realm/ldap/ActiveDirectoryServer.java
浏览文件 @
2fe1f9f6
...
...
@@ -36,6 +36,8 @@ public final class ActiveDirectoryServer implements IAuthenticationServer {
String
filter
;
boolean
mapping
;
/* (non-Javadoc)
* @see com.connsec.web.authentication.realm.IAuthenticationServer#authenticate(java.lang.String, java.lang.String)
*/
...
...
@@ -75,4 +77,11 @@ public final class ActiveDirectoryServer implements IAuthenticationServer {
this
.
filter
=
filter
;
}
public
boolean
isMapping
()
{
return
mapping
;
}
public
void
setMapping
(
boolean
mapping
)
{
this
.
mapping
=
mapping
;
}
}
maxkey-authentications/maxkey-authentication-core/src/main/java/org/maxkey/authn/realm/ldap/LdapAuthenticationRealm.java
浏览文件 @
2fe1f9f6
...
...
@@ -61,8 +61,12 @@ public class LdapAuthenticationRealm extends AbstractAuthenticationRealm{
public
boolean
passwordMatches
(
UserInfo
userInfo
,
String
password
)
{
boolean
isAuthenticated
=
false
;
for
(
final
IAuthenticationServer
ldapServer
:
this
.
ldapServers
)
{
_logger
.
debug
(
"Attempting to authenticate {} at {}"
,
userInfo
.
getUsername
(),
ldapServer
);
isAuthenticated
=
ldapServer
.
authenticate
(
userInfo
.
getUsername
(),
password
);
String
username
=
userInfo
.
getUsername
();
if
(
ldapServer
.
isMapping
())
{
//if ldap Context accountMapping equals YES
username
=
userInfo
.
getWindowsAccount
();
}
_logger
.
debug
(
"Attempting to authenticate {} at {}"
,
username
,
ldapServer
);
isAuthenticated
=
ldapServer
.
authenticate
(
username
,
password
);
if
(
isAuthenticated
)
{
return
true
;
}
...
...
maxkey-authentications/maxkey-authentication-core/src/main/java/org/maxkey/authn/realm/ldap/LdapAuthenticationRealmService.java
浏览文件 @
2fe1f9f6
...
...
@@ -60,6 +60,9 @@ public class LdapAuthenticationRealmService {
ldapContext
.
getCredentials
(),
ldapContext
.
getMsadDomain
());
ldapServer
.
setActiveDirectoryUtils
(
ldapUtils
);
if
(
ldapContext
.
getAccountMapping
().
equalsIgnoreCase
(
"YES"
))
{
ldapServer
.
setMapping
(
true
);
}
ldapAuthenticationServers
.
add
(
ldapServer
);
}
else
{
...
...
@@ -71,6 +74,9 @@ public class LdapAuthenticationRealmService {
ldapContext
.
getBasedn
());
standardLdapServer
.
setLdapUtils
(
ldapUtils
);
standardLdapServer
.
setFilterAttribute
(
ldapContext
.
getFilters
());
if
(
ldapContext
.
getAccountMapping
().
equalsIgnoreCase
(
"YES"
))
{
standardLdapServer
.
setMapping
(
true
);
}
ldapAuthenticationServers
.
add
(
standardLdapServer
);
}
}
...
...
maxkey-authentications/maxkey-authentication-core/src/main/java/org/maxkey/authn/realm/ldap/StandardLdapServer.java
浏览文件 @
2fe1f9f6
...
...
@@ -41,6 +41,8 @@ public final class StandardLdapServer implements IAuthenticationServer {
String
filterAttribute
;
boolean
mapping
;
/* (non-Javadoc)
* @see com.connsec.web.authentication.realm.IAuthenticationServer#authenticate(java.lang.String, java.lang.String)
*/
...
...
@@ -95,4 +97,12 @@ public final class StandardLdapServer implements IAuthenticationServer {
this
.
filterAttribute
=
filterAttribute
;
}
public
boolean
isMapping
()
{
return
mapping
;
}
public
void
setMapping
(
boolean
mapping
)
{
this
.
mapping
=
mapping
;
}
}
maxkey-core/src/main/java/org/maxkey/entity/LdapContext.java
浏览文件 @
2fe1f9f6
...
...
@@ -54,6 +54,8 @@ public class LdapContext extends JpaBaseEntity implements Serializable {
@Column
String
msadDomain
;
@Column
String
accountMapping
;
@Column
String
sslSwitch
;
@Column
String
trustStore
;
...
...
@@ -152,6 +154,14 @@ public class LdapContext extends JpaBaseEntity implements Serializable {
this
.
sslSwitch
=
sslSwitch
;
}
public
String
getAccountMapping
()
{
return
accountMapping
;
}
public
void
setAccountMapping
(
String
accountMapping
)
{
this
.
accountMapping
=
accountMapping
;
}
public
String
getTrustStore
()
{
return
trustStore
;
}
...
...
maxkey-core/src/main/java/org/maxkey/web/MetadataEndpoint.java
浏览文件 @
2fe1f9f6
...
...
@@ -32,12 +32,12 @@ public class MetadataEndpoint {
version
.
append
(
"---------------------------------------------------------------------------------\n"
);
version
.
append
(
"+ JAVA \n"
);
version
.
append
(
String
.
format
(
"+
%s java version %s, class %s\n"
,
version
.
append
(
String
.
format
(
"+ %s java version %s, class %s\n"
,
SystemUtils
.
JAVA_VENDOR
,
SystemUtils
.
JAVA_VERSION
,
SystemUtils
.
JAVA_CLASS_VERSION
));
version
.
append
(
String
.
format
(
"+
%s (build %s, %s)\n"
,
version
.
append
(
String
.
format
(
"+ %s (build %s, %s)\n"
,
SystemUtils
.
JAVA_VM_NAME
,
SystemUtils
.
JAVA_VM_VERSION
,
SystemUtils
.
JAVA_VM_INFO
...
...
maxkey-webs/maxkey-web-mgt/src/main/resources/messages/message.properties
浏览文件 @
2fe1f9f6
...
...
@@ -531,6 +531,7 @@ ldapcontext.credentials=\u51ED\u8BC1
ldapcontext.filters
=
\u
8FC7
\u
6EE4
\u5668
ldapcontext.basedn
=
\u
57FA
\u
672CDN
ldapcontext.msadDomain
=
Active Directory
\u
57DF
ldapcontext.accountMapping
=
\u
8D26
\u
53F7
\u6620\u
5C04
ldapcontext.sslSwitch
=
SSL
ldapcontext.trustStore
=
\u
8BC1
\u
4E66
ldapcontext.trustStorePassword
=
\u
8BC1
\u
4E66
\u
5BC6
\u
94A5
...
...
maxkey-webs/maxkey-web-mgt/src/main/resources/messages/message_en.properties
浏览文件 @
2fe1f9f6
...
...
@@ -539,6 +539,7 @@ ldapcontext.credentials=Credentials
ldapcontext.filters
=
Filters
ldapcontext.basedn
=
Base DN
ldapcontext.msadDomain
=
Active Directory Domain
ldapcontext.accountMapping
=
Account Mapping
ldapcontext.sslSwitch
=
SSL
ldapcontext.trustStore
=
TrustStore
ldapcontext.trustStorePassword
=
TrustStorePassword
...
...
maxkey-webs/maxkey-web-mgt/src/main/resources/messages/message_zh_CN.properties
浏览文件 @
2fe1f9f6
...
...
@@ -530,6 +530,7 @@ ldapcontext.credentials=\u51ED\u8BC1
ldapcontext.filters
=
\u
8FC7
\u
6EE4
\u5668
ldapcontext.basedn
=
\u
57FA
\u
672CDN
ldapcontext.msadDomain
=
Active Directory
\u
57DF
ldapcontext.accountMapping
=
\u
8D26
\u
53F7
\u6620\u
5C04
ldapcontext.sslSwitch
=
SSL
ldapcontext.trustStore
=
\u
8BC1
\u
4E66
ldapcontext.trustStorePassword
=
\u
8BC1
\u
4E66
\u
5BC6
\u
94A5
...
...
maxkey-webs/maxkey-web-mgt/src/main/resources/templates/views/ldapcontext/updateLdapContext.ftl
浏览文件 @
2fe1f9f6
...
...
@@ -67,9 +67,26 @@
</div>
</div>
<div
class=
"row mb-3"
>
<label
class=
"col-md-2 col-form-label"
><
@
locale
code=
"ldapcontext.providerUrl"
/></label>
<div
class=
"col-md-10"
>
<input
required=
""
class=
"form-control"
type=
"text"
id=
"providerUrl"
name=
"providerUrl"
value=
"${model.providerUrl!}"
/>
<div
class=
"col-md-6"
>
<div
class=
"form-group row"
>
<label
class=
"col-sm-3 col-form-label"
><
@
locale
code=
"ldapcontext.providerUrl"
/></label>
<div
class=
"col-sm-9"
>
<input
required=
""
class=
"form-control"
type=
"text"
id=
"providerUrl"
name=
"providerUrl"
value=
"${model.providerUrl!}"
/>
</div>
</div>
</div>
<div
class=
"col-md-6"
>
<div
class=
"form-group row"
>
<label
class=
"col-sm-3 col-form-label"
><
@
locale
code=
"ldapcontext.accountMapping"
/></label>
<div
class=
"col-sm-9"
>
<select
id=
"accountMapping"
name=
"accountMapping"
class=
"form-control form-select"
>
<option
value=
"YES"
<
#if
'
YES
'==
model.accountMapping
>
selected
</
#
if>
>
<
@
locale
code=
"common.text.yes"
/></option>
<option
value=
"NO"
<
#if
'
NO
'==
model.accountMapping
>
selected
</
#
if>
>
<
@
locale
code=
"common.text.no"
/></option>
</select>
</div>
</div>
</div>
</div>
<div
class=
"row mb-3"
>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录