Commit 92c6e438 authored by ls1947's avatar ls1947
Browse files

show password set page for service with ecp disabled

parent bf273df3
...@@ -257,8 +257,10 @@ public class RegisterServiceBean implements Serializable { ...@@ -257,8 +257,10 @@ public class RegisterServiceBean implements Serializable {
user.getEppn(), service.getName(), service.getRegisterBean() user.getEppn(), service.getName(), service.getRegisterBean()
}); });
RegistryEntity registry;
try { try {
registerUserService.registerUser(user, service, "user-self"); registry = registerUserService.registerUser(user, service, "user-self");
sessionManager.setUnregisteredServiceCreated(null); sessionManager.setUnregisteredServiceCreated(null);
} catch (RegisterException e) { } catch (RegisterException e) {
FacesContext.getCurrentInstance().addMessage("need_check", FacesContext.getCurrentInstance().addMessage("need_check",
...@@ -279,6 +281,12 @@ public class RegisterServiceBean implements Serializable { ...@@ -279,6 +281,12 @@ public class RegisterServiceBean implements Serializable {
sessionManager.setOriginalRequestPath(null); sessionManager.setOriginalRequestPath(null);
return null; return null;
} }
else if (service.getServiceProps().containsKey("ecp") &&
service.getServiceProps().get("ecp").equalsIgnoreCase("disabled")) {
ExternalContext context = FacesContext.getCurrentInstance().getExternalContext();
context.redirect("../service/set-password.xhtml?registryId=" + registry.getId());
return null;
}
else if (sessionManager.getOriginalRequestPath() != null) { else if (sessionManager.getOriginalRequestPath() != null) {
ExternalContext context = FacesContext.getCurrentInstance().getExternalContext(); ExternalContext context = FacesContext.getCurrentInstance().getExternalContext();
context.redirect(sessionManager.getOriginalRequestPath()); context.redirect(sessionManager.getOriginalRequestPath());
......
...@@ -98,6 +98,8 @@ public class SetServicePasswordBean implements Serializable { ...@@ -98,6 +98,8 @@ public class SetServicePasswordBean implements Serializable {
if (! authBean.isUserInService(serviceEntity)) if (! authBean.isUserInService(serviceEntity))
throw new IllegalArgumentException("Not authorized for this service"); throw new IllegalArgumentException("Not authorized for this service");
serviceEntity = serviceService.findByIdWithServiceProps(serviceEntity.getId());
password1 = null; password1 = null;
password2 = null; password2 = null;
......
...@@ -15,6 +15,7 @@ twofa_create_totp_token_desc=<div style\="margin-bottom\: 16px;">Hier k\u00F6nne ...@@ -15,6 +15,7 @@ twofa_create_totp_token_desc=<div style\="margin-bottom\: 16px;">Hier k\u00F6nne
twofa_create_new_yubico=Neues Yubikey Token twofa_create_new_yubico=Neues Yubikey Token
twofa_mandatory=F\u00FCr diesen Dienst ist es notwendig einen zweiten Faktor einzurichten. Bitte richten Sie sich <a href\="../user/twofa.xhtml?retsid\=$service.id">hier</a> einen zweiten Faktor ein. twofa_mandatory=F\u00FCr diesen Dienst ist es notwendig einen zweiten Faktor einzurichten. Bitte richten Sie sich <a href\="../user/twofa.xhtml?retsid\=$service.id">hier</a> einen zweiten Faktor ein.
twofa_back_to_register=Zur\u00FCck zum Registriervorgang twofa_back_to_register=Zur\u00FCck zum Registriervorgang
service_password_help_change_ecp_disabled=F\u00FCr diesen Dienst muss ein Dienstpasswort gesetzt werden. Es ist nicht m\u00F6glich sich mit dem Heimatpasswort anzumelden.
check=Pr\u00FCfen check=Pr\u00FCfen
twofa_elevated_since_recently=Mit 2FA eben twofa_elevated_since_recently=Mit 2FA eben
logged_in_since_recently=Eingeloggt seit eben logged_in_since_recently=Eingeloggt seit eben
......
...@@ -15,6 +15,7 @@ twofa_create_totp_token=Create new smartphone token ...@@ -15,6 +15,7 @@ twofa_create_totp_token=Create new smartphone token
twofa_create_totp_token_desc=<div style\="margin-bottom\: 16px;">Here you can register your smartphone as a token. For this you need a suitable app according to RFC 6238 (e.g. Google Authenticator, Microsoft Authenticator, FreeOTP or Sophos Authenticator).</div>\n\n<div style\="margin-bottom\: 16px;">\n<a href\='https\://play.google.com/store/apps/details?id\=com.google.android.apps.authenticator2&hl\=en&pcampaignid\=pcampaignidMKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1'><img alt\='Get it on Google Play' src\='../resources/img/en_badge_web_generic.png'/></a>\n\n<a href\='https\://apps.apple.com/us/app/google-authenticator/id388497605'><img alt\='Download on Apple Store' src\='../resources/img/link_badge_appstore_large.png'/></a>\n</div>\n\n<div style\="margin-bottom\: 16px;">When you click Start, the token is created and a QR Code is displayed. You must scan this code with the app on your smartphone.</div> twofa_create_totp_token_desc=<div style\="margin-bottom\: 16px;">Here you can register your smartphone as a token. For this you need a suitable app according to RFC 6238 (e.g. Google Authenticator, Microsoft Authenticator, FreeOTP or Sophos Authenticator).</div>\n\n<div style\="margin-bottom\: 16px;">\n<a href\='https\://play.google.com/store/apps/details?id\=com.google.android.apps.authenticator2&hl\=en&pcampaignid\=pcampaignidMKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1'><img alt\='Get it on Google Play' src\='../resources/img/en_badge_web_generic.png'/></a>\n\n<a href\='https\://apps.apple.com/us/app/google-authenticator/id388497605'><img alt\='Download on Apple Store' src\='../resources/img/link_badge_appstore_large.png'/></a>\n</div>\n\n<div style\="margin-bottom\: 16px;">When you click Start, the token is created and a QR Code is displayed. You must scan this code with the app on your smartphone.</div>
twofa_login_text=To perform the requested action, a second factor must be entered. Please enter any second factor from the list below to continue. twofa_login_text=To perform the requested action, a second factor must be entered. Please enter any second factor from the list below to continue.
twofa_login=Login with second factor twofa_login=Login with second factor
service_password_help_change_ecp_disabled=A service password must be set for this service. It is not possible to log on with the password of your home organisation.
twofa_code=Current code twofa_code=Current code
twofa_mandatory=For this service it is necessary to set up a second factor. Please set up a second factor <a href\="../user/twofa.xhtml?retsid\=$service.id">here</a>. twofa_mandatory=For this service it is necessary to set up a second factor. Please set up a second factor <a href\="../user/twofa.xhtml?retsid\=$service.id">here</a>.
twofa_back_to_register=Back to registration twofa_back_to_register=Back to registration
...@@ -399,7 +400,7 @@ service_source=Service source ...@@ -399,7 +400,7 @@ service_source=Service source
service_users=Registered users service_users=Registered users
service_users_depro=Deregistered users service_users_depro=Deregistered users
set_new_password=Set new password set_new_password=Set new password
set_password=Set password set_password=Set servicepassword
set_sns_password=Sync&Share Password set_sns_password=Sync&Share Password
shibboleth=Shibboleth shibboleth=Shibboleth
short_name=Short name short_name=Short name
......
...@@ -25,37 +25,36 @@ ...@@ -25,37 +25,36 @@
<ui:define name="content"> <ui:define name="content">
<h:form id="form"> <h:form id="form">
<div id="panelInline"> <p:panel header="#{messages.set_password} (#{setServicePasswordBean.serviceEntity.name})">
<p:panel header="#{messages.set_password}"> <div style="margin-bottom: 8px;">
<div style="margin-bottom: 8px;"> <h:outputText value="#{messages.service_password_help_change_ecp_disabled}" escape="false"
<h:outputText value="#{messages.service_password_help_change}" escape="false" /> rendered="#{setServicePasswordBean.serviceEntity.serviceProps.containsKey('ecp') and setServicePasswordBean.serviceEntity.serviceProps.get('ecp').equalsIgnoreCase('disabled')}"/>
</div> <h:outputText value="#{messages.service_password_help_change}" escape="false"
<p:messages id="messageBox" for="pw_error" showDetail="true" /> rendered="#{not (setServicePasswordBean.serviceEntity.serviceProps.containsKey('ecp') and setServicePasswordBean.serviceEntity.serviceProps.get('ecp').equalsIgnoreCase('disabled'))}"/>
<p:panelGrid id="baseData" columns="2"> </div>
<h:outputLabel for="password1" value="#{messages.password}:" /> <p:messages id="messageBox" for="pw_error" showDetail="true" />
<h:inputSecret id="password1" redisplay="true" size="50" value="#{setServicePasswordBean.password1}" /> <p:panelGrid id="baseData" columns="2">
<h:outputLabel for="password1" value="#{messages.password}:" />
<h:outputLabel for="password2" value="#{messages.password_retype}:" /> <h:inputSecret id="password1" redisplay="true" size="50" value="#{setServicePasswordBean.password1}" />
<h:inputSecret id="password2" redisplay="true" size="50" value="#{setServicePasswordBean.password2}" />
</p:panelGrid> <h:outputLabel for="password2" value="#{messages.password_retype}:" />
<div> <h:inputSecret id="password2" redisplay="true" size="50" value="#{setServicePasswordBean.password2}" />
<p:commandButton id="save" action="#{setServicePasswordBean.save()}" value="#{messages.save}" </p:panelGrid>
update="messageBox,baseData" /> <div>
</div> <p:commandButton id="save" action="#{setServicePasswordBean.save()}" value="#{messages.save}"
</p:panel> update="messageBox,baseData" />
</div> </div>
</p:panel>
<div id="panelInline" style="margin-top: 8px;"> <p:panel header="#{messages.delete_password} (#{setServicePasswordBean.serviceEntity.name})">
<p:panel header="#{messages.delete_password}"> <div style="margin-bottom: 8px;">
<div style="margin-bottom: 8px;"> <h:outputText value="#{messages.service_password_help_delete}" escape="false" />
<h:outputText value="#{messages.service_password_help_delete}" escape="false" /> </div>
</div> <div>
<div> <p:commandButton id="delete" action="#{setServicePasswordBean.deleteServicePassword()}" value="#{messages.delete}"
<p:commandButton id="delete" action="#{setServicePasswordBean.deleteServicePassword()}" value="#{messages.delete}" update="messageBox,baseData" />
update="messageBox,baseData" /> </div>
</div> </p:panel>
</p:panel>
</div>
</h:form> </h:form>
</ui:define> </ui:define>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment