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
36f872b0
Commit
36f872b0
authored
Aug 05, 2020
by
ls1947
Browse files
add simple possibility to show back tans
parent
ceeaab65
Changes
2
Hide whitespace changes
Inline
Side-by-side
bwreg-webapp/src/main/java/edu/kit/scc/webreg/bean/TwoFaUserBean.java
View file @
36f872b0
...
...
@@ -60,6 +60,8 @@ public class TwoFaUserBean implements Serializable {
private
String
totpCode
,
yubicoCode
;
private
String
defaultButton
;
private
LinotpGetBackupTanListResponse
backupTanList
;
private
Long
returnServiceId
;
public
void
preRenderView
(
ComponentSystemEvent
ev
)
{
...
...
@@ -156,7 +158,7 @@ public class TwoFaUserBean implements Serializable {
public
void
getBackupTanList
(
String
serial
)
{
if
(!
getReadOnly
())
{
try
{
LinotpGetB
ackupTanList
Response
response
=
twoFaService
.
getBackupTanList
(
user
.
getId
(),
serial
,
"user-"
+
user
.
getId
());
b
ackupTanList
=
twoFaService
.
getBackupTanList
(
user
.
getId
(),
serial
,
"user-"
+
user
.
getId
());
}
catch
(
TwoFaException
e
)
{
logger
.
warn
(
"TwoFaException"
,
e
);
...
...
@@ -309,4 +311,8 @@ public class TwoFaUserBean implements Serializable {
}
}
public
LinotpGetBackupTanListResponse
getBackupTanList
()
{
return
backupTanList
;
}
}
bwreg-webapp/src/main/webapp/user/twofa.xhtml
View file @
36f872b0
...
...
@@ -108,7 +108,8 @@
<p:confirm
header=
"#{messages.confirm_header}"
message=
"#{messages.confirm}"
/>
</p:commandButton>
<p:commandButton
action=
"#{twoFaUserBean.getBackupTanList(token.serial)}"
value=
"#{messages.token_get_tanlist_values}"
update=
"@form"
rendered=
"#{token.isactive and token.tokenType == 'HMAC'}"
/>
update=
"@form"
rendered=
"#{token.isactive and token.tokenType == 'HMAC'}"
oncomplete=
"PF('showBackupTanDlg').show();"
/>
</p:outputPanel>
</p:panelGrid>
</p:panel>
...
...
@@ -129,7 +130,13 @@
</p:link>
</p:outputPanel>
</p:panel>
<p:dialog
header=
"#{messages.twofa_backup_tan_list_values}"
widgetVar=
"showBackupTanDlg"
id=
"showBackupTanId"
modal=
"true"
closable=
"true"
closeOnEscape=
"true"
showEffect=
"fade"
hideEffect=
"fade"
>
<h:outputText
value=
"#{twoFaUserBean.backupTanList.result.value.otp}"
/>
</p:dialog>
<p:dialog
header=
"#{messages.twofa_create_totp_token}"
widgetVar=
"addTotpDlg"
id=
"addTotpDlgId"
modal=
"true"
closable=
"true"
closeOnEscape=
"true"
showEffect=
"fade"
hideEffect=
"fade"
>
...
...
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