Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MaxKey单点登录官方(MaxKeyTop)
MaxKey
提交
e31a83b6
MaxKey
项目概览
MaxKey单点登录官方(MaxKeyTop)
/
MaxKey
大约 1 年 前同步成功
通知
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,发现更多精彩内容 >>
提交
e31a83b6
编写于
4月 22, 2022
作者:
M
MaxKey
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
otpCaptcha
上级
a02822d0
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
34 addition
and
7 deletion
+34
-7
maxkey-authentications/maxkey-authentication-captcha/src/main/java/org/maxkey/web/contorller/ImageCaptchaEndpoint.java
.../java/org/maxkey/web/contorller/ImageCaptchaEndpoint.java
+1
-1
maxkey-authentications/maxkey-authentication-core/src/main/java/org/maxkey/authn/provider/NormalAuthenticationProvider.java
...g/maxkey/authn/provider/NormalAuthenticationProvider.java
+5
-1
maxkey-core/src/main/java/org/maxkey/configuration/LoginConfig.java
...e/src/main/java/org/maxkey/configuration/LoginConfig.java
+10
-1
maxkey-webs/maxkey-web-maxkey/src/main/java/org/maxkey/web/endpoint/LoginEntryPoint.java
...rc/main/java/org/maxkey/web/endpoint/LoginEntryPoint.java
+6
-2
maxkey-webs/maxkey-web-maxkey/src/main/resources/application-http.properties
...web-maxkey/src/main/resources/application-http.properties
+2
-0
maxkey-webs/maxkey-web-maxkey/src/main/resources/application-https.properties
...eb-maxkey/src/main/resources/application-https.properties
+2
-0
maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/web/contorller/LoginEntryPoint.java
.../main/java/org/maxkey/web/contorller/LoginEntryPoint.java
+6
-2
maxkey-webs/maxkey-web-mgt/src/main/resources/application-http.properties
...ey-web-mgt/src/main/resources/application-http.properties
+2
-0
未找到文件。
maxkey-authentications/maxkey-authentication-captcha/src/main/java/org/maxkey/web/contorller/ImageCaptchaEndpoint.java
浏览文件 @
e31a83b6
...
...
@@ -84,7 +84,7 @@ public class ImageCaptchaEndpoint {
if
(
StringUtils
.
isNotBlank
(
state
)
&&
!
state
.
equalsIgnoreCase
(
"state"
)
&&
authJwtService
.
validateJwtToken
(
state
))
{
//
do nothing
//
just validate state Token
}
else
{
state
=
authJwtService
.
genJwt
();
}
...
...
maxkey-authentications/maxkey-authentication-core/src/main/java/org/maxkey/authn/provider/NormalAuthenticationProvider.java
浏览文件 @
e31a83b6
...
...
@@ -79,7 +79,11 @@ public class NormalAuthenticationProvider extends AbstractAuthenticationProvider
_logger
.
debug
(
"authentication "
+
loginCredential
);
Institutions
inst
=
(
Institutions
)
WebContext
.
getAttribute
(
WebConstants
.
CURRENT_INST
);
if
(
inst
.
getCaptchaSupport
().
equalsIgnoreCase
(
"YES"
))
{
if
(
this
.
applicationConfig
.
getLoginConfig
().
isCaptcha
())
{
captchaValid
(
loginCredential
.
getState
(),
loginCredential
.
getCaptcha
());
}
else
if
(
inst
.
getCaptchaSupport
().
equalsIgnoreCase
(
"YES"
))
{
captchaValid
(
loginCredential
.
getState
(),
loginCredential
.
getCaptcha
());
}
...
...
maxkey-core/src/main/java/org/maxkey/configuration/LoginConfig.java
浏览文件 @
e31a83b6
...
...
@@ -23,6 +23,9 @@ import org.springframework.context.annotation.Configuration;
@Configuration
public
class
LoginConfig
{
@Value
(
"${maxkey.login.captcha}"
)
boolean
captcha
;
@Value
(
"${maxkey.login.mfa}"
)
boolean
mfa
;
...
...
@@ -41,9 +44,15 @@ public class LoginConfig {
public
LoginConfig
()
{
}
public
boolean
isCaptcha
()
{
return
captcha
;
}
public
void
setCaptcha
(
boolean
captcha
)
{
this
.
captcha
=
captcha
;
}
public
boolean
isKerberos
()
{
public
boolean
isKerberos
()
{
return
kerberos
;
}
...
...
maxkey-webs/maxkey-web-maxkey/src/main/java/org/maxkey/web/endpoint/LoginEntryPoint.java
浏览文件 @
e31a83b6
...
...
@@ -118,8 +118,12 @@ public class LoginEntryPoint {
Institutions
inst
=
(
Institutions
)
WebContext
.
getAttribute
(
WebConstants
.
CURRENT_INST
);
model
.
put
(
"inst"
,
inst
);
model
.
put
(
"captcha"
,
inst
.
getCaptchaSupport
());
model
.
put
(
"captchaType"
,
inst
.
getCaptchaType
());
if
(
applicationConfig
.
getLoginConfig
().
isCaptcha
())
{
model
.
put
(
"captcha"
,
"true"
);
}
else
{
model
.
put
(
"captcha"
,
inst
.
getCaptchaSupport
());
model
.
put
(
"captchaType"
,
inst
.
getCaptchaType
());
}
model
.
put
(
"state"
,
authJwtService
.
genJwt
());
//load Social Sign On Providers
model
.
put
(
"socials"
,
socialSignOnProviderService
.
loadSocials
(
inst
.
getId
()));
...
...
maxkey-webs/maxkey-web-maxkey/src/main/resources/application-http.properties
浏览文件 @
e31a83b6
...
...
@@ -56,6 +56,8 @@ maxkey.auth.jwt.secret =7heM-14BtxjyKPuH3ITIm7q2-ps5MuB
############################################################################
#Login configuration #
############################################################################
#enable captcha
maxkey.login.captcha
=
${LOGIN_CAPTCHA:false}
#enable two factor,use one time password
maxkey.login.mfa
=
${LOGIN_MFA_ENABLED:true}
#TimeBasedOtpAuthn MailOtpAuthn SmsOtpAuthnYunxin SmsOtpAuthnAliyun SmsOtpAuthnTencentCloud
...
...
maxkey-webs/maxkey-web-maxkey/src/main/resources/application-https.properties
浏览文件 @
e31a83b6
...
...
@@ -52,6 +52,8 @@ maxkey.auth.jwt.secret =7heM-14BtxjyKPuH3ITIm7q2-ps5MuB
############################################################################
#Login configuration #
############################################################################
#enable captcha
maxkey.login.captcha
=
${LOGIN_CAPTCHA:false}
#enable two factor,use one time password
maxkey.login.mfa
=
${LOGIN_MFA_ENABLED:true}
#TimeBasedOtpAuthn MailOtpAuthn SmsOtpAuthnYunxin SmsOtpAuthnAliyun SmsOtpAuthnTencentCloud
...
...
maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/web/contorller/LoginEntryPoint.java
浏览文件 @
e31a83b6
...
...
@@ -70,8 +70,12 @@ public class LoginEntryPoint {
model
.
put
(
"isRemeberMe"
,
applicationConfig
.
getLoginConfig
().
isRemeberMe
());
Institutions
inst
=
(
Institutions
)
WebContext
.
getAttribute
(
WebConstants
.
CURRENT_INST
);
model
.
put
(
"inst"
,
inst
);
model
.
put
(
"captcha"
,
inst
.
getCaptchaSupport
());
model
.
put
(
"captchaType"
,
inst
.
getCaptchaType
());
if
(
applicationConfig
.
getLoginConfig
().
isCaptcha
())
{
model
.
put
(
"captcha"
,
"true"
);
}
else
{
model
.
put
(
"captcha"
,
inst
.
getCaptchaSupport
());
model
.
put
(
"captchaType"
,
inst
.
getCaptchaType
());
}
model
.
put
(
"state"
,
authJwtService
.
genJwt
());
return
new
Message
<
HashMap
<
String
,
Object
>>(
model
).
buildResponse
();
}
...
...
maxkey-webs/maxkey-web-mgt/src/main/resources/application-http.properties
浏览文件 @
e31a83b6
...
...
@@ -46,6 +46,8 @@ maxkey.auth.jwt.secret =7heM-14BtxjyKPuH3ITIm7q2-ps5MuB
############################################################################
#Login configuration #
############################################################################
#enable captcha
maxkey.login.captcha
=
${LOGIN_CAPTCHA:true}
#enable two factor,use one time password
maxkey.login.mfa
=
false
#Enable kerberos/SPNEGO
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录