Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the "Set new Password and Rest OTP" should be mandatory for initial 2FA passwords #287

Merged
merged 4 commits into from
Mar 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -200,5 +200,6 @@ public void toPasswordOutVO(
target.setExpiration(ServiceUtil.getLogonExpirationDate(source));
}
target.setOtpType(L10nUtil.createOTPAuthenticatorTypeVO(Locales.USER, source.getOtpType()));
target.setHasOtpSecret(source.getEncryptedOtpSecret() != null ? source.getEncryptedOtpSecret().length > 0 : false);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1906,7 +1906,11 @@ public static Password createPassword(boolean resetLogons, boolean resetOtpSecre
password.setShowOtpRegistrationInfo(false);
}
if (!resetOtpSecret && password.getOtpType() != null && lastPassword != null) {
resetOtpSecret = !password.getOtpType().equals(lastPassword.getOtpType());
if (lastPassword.getEncryptedOtpSecret() != null && lastPassword.getEncryptedOtpSecret().length > 0) {
resetOtpSecret = !password.getOtpType().equals(lastPassword.getOtpType());
} else {
resetOtpSecret = true;
}
}
if (resetOtpSecret) {
if (password.getOtpType() != null) {
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

3,939 changes: 1,484 additions & 2,455 deletions mda/src/main/uml/UML_Standard_Profile.MagicDraw_Profile.profile.uml

Large diffs are not rendered by default.

178 changes: 89 additions & 89 deletions mda/src/main/uml/UML_Standard_Profile.StandardProfileL2.profile.uml

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2,046 changes: 1,026 additions & 1,020 deletions mda/src/main/uml/UML_Standard_Profile.Validation_Profile.profile.uml

Large diffs are not rendered by default.

778 changes: 389 additions & 389 deletions mda/src/main/uml/andromda-common.andromda-persistence.profile.uml

Large diffs are not rendered by default.

342 changes: 171 additions & 171 deletions mda/src/main/uml/andromda-common.andromda-service.profile.uml

Large diffs are not rendered by default.

270 changes: 135 additions & 135 deletions mda/src/main/uml/andromda-common.profile.uml

Large diffs are not rendered by default.

256 changes: 128 additions & 128 deletions mda/src/main/uml/andromda-presentation.profile.uml

Large diffs are not rendered by default.

100 changes: 50 additions & 50 deletions mda/src/main/uml/andromda-process.profile.uml

Large diffs are not rendered by default.

386 changes: 193 additions & 193 deletions mda/src/main/uml/andromda-webservice.profile.uml

Large diffs are not rendered by default.

98 changes: 49 additions & 49 deletions mda/src/main/uml/andromda-xml.profile.uml

Large diffs are not rendered by default.

2,006 changes: 1,005 additions & 1,001 deletions mda/src/main/uml/ctsms.uml

Large diffs are not rendered by default.

2,882 changes: 1,450 additions & 1,432 deletions mda/src/main/uml/ctsms.xml

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions web/src/main/webapp/META-INF/includes/user/password.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@
actionListener="#{passwordBean.add}"
oncomplete="handleUpdateUserTabTitles(xhr, status, args)"
icon="ui-icon ui-icon-disk" ajax="true"
disabled="#{!passwordBean.createable or (!passwordBean.created and passwordBean.in.enable2fa)}"
disabled="#{!passwordBean.createable or ((!passwordBean.created or !passwordBean.out.hasOtpSecret) and passwordBean.in.enable2fa)}"
update="password_input,passwordadd_departmentpassword"/>

<p:commandButton process="@this,password_input"
Expand Down Expand Up @@ -461,7 +461,7 @@
onstart="setHiddenField('tabView:password_form:departmentPassword',passwordAddDepartmentPassword.getValue());passwordAddDepartmentPasswordDialog.hide();"
oncomplete="handleUpdateUserTabTitles(xhr, status, args)"
icon="ui-icon ui-icon-disk" ajax="true"
disabled="#{(!passwordBean.created and passwordBean.in.enable2fa)}"
disabled="#{((!passwordBean.created or !passwordBean.out.hasOtpSecret) and passwordBean.in.enable2fa)}"
update="password_input,passwordadd_departmentpassword" />
<p:commandButton process="@this,password_input"
id="addPasswordResetOtpSecretDepartment"
Expand Down
Loading