Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
reg-app
Regapp
Commits
8d9b2d64
Commit
8d9b2d64
authored
Jul 20, 2020
by
ls1947
Browse files
add expiry for sshkey twofa
parent
936b28ec
Changes
1
Hide whitespace changes
Inline
Side-by-side
bwreg-service/src/main/java/edu/kit/scc/webreg/service/ssh/SshLoginServiceImpl.java
View file @
8d9b2d64
...
...
@@ -72,9 +72,18 @@ public class SshLoginServiceImpl implements SshLoginService {
if
(
loginInfo
!=
null
&&
loginInfo
.
getLoginStatus
().
equals
(
UserLoginInfoStatus
.
SUCCESS
))
{
// check expiry for twofa
Long
expiry
=
60L
*
60L
*
1000L
;
if
(
service
.
getServiceProps
().
containsKey
(
"twofa_expiry"
))
{
expiry
=
Long
.
parseLong
(
service
.
getServiceProps
().
get
(
"twofa_expiry"
));
}
List
<
SshPubKeyRegistryEntity
>
regKeyList
=
sshPubKeyRegistryDao
.
findByRegistryForInteractiveLogin
(
registry
.
getId
());
return
buildKeyList
(
regKeyList
,
user
);
if
((
System
.
currentTimeMillis
()
-
loginInfo
.
getLoginDate
().
getTime
())
<
expiry
)
{
List
<
SshPubKeyRegistryEntity
>
regKeyList
=
sshPubKeyRegistryDao
.
findByRegistryForInteractiveLogin
(
registry
.
getId
());
return
buildKeyList
(
regKeyList
,
user
);
}
else
{
return
""
;
}
}
else
{
return
""
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment