diff --git a/forms/common-themes/src/main/resources/theme/login/base/login.ftl b/forms/common-themes/src/main/resources/theme/login/base/login.ftl index abf4652667..9bc157009e 100755 --- a/forms/common-themes/src/main/resources/theme/login/base/login.ftl +++ b/forms/common-themes/src/main/resources/theme/login/base/login.ftl @@ -5,66 +5,76 @@ <#elseif section = "header"> ${rb.loginTitle} ${(realm.name)!''} <#elseif section = "form"> -
-
-
- + <#if realm.password> + +
+
+ +
+ +
+ +
-
- -
-
+
+
+ +
-
-
- +
+ +
-
- -
-
- -
-
- <#if realm.rememberMe> -
- -
- -
- <#if realm.resetPasswordAllowed> - ${rb.loginForgot} ${rb.password}? +
+
+ <#if realm.rememberMe> +
+ +
+
+ <#if realm.resetPasswordAllowed> + ${rb.loginForgot} ${rb.password}? + +
-
-
-
- - -
-
+
+
+ + +
+
+
+ + <#elseif realm.social> +
+
- + <#elseif section = "info" > - <#if realm.registrationAllowed> + <#if realm.password && realm.registrationAllowed>
${rb.noAccount} ${rb.register}
- <#if social.providers??> -
- -
+ <#if realm.password && social.providers??> +
+ +
diff --git a/forms/login-freemarker/src/main/java/org/keycloak/login/freemarker/model/RealmBean.java b/forms/login-freemarker/src/main/java/org/keycloak/login/freemarker/model/RealmBean.java index a6b52f0786..3dcebd8baf 100755 --- a/forms/login-freemarker/src/main/java/org/keycloak/login/freemarker/model/RealmBean.java +++ b/forms/login-freemarker/src/main/java/org/keycloak/login/freemarker/model/RealmBean.java @@ -22,6 +22,8 @@ package org.keycloak.login.freemarker.model; import org.keycloak.models.RealmModel; +import org.keycloak.models.RequiredCredentialModel; +import org.keycloak.representations.idm.CredentialRepresentation; /** * @author Stian Thorgersen @@ -53,5 +55,14 @@ public class RealmBean { public boolean isRememberMe() { return realm.isRememberMe(); } + + public boolean isPassword() { + for (RequiredCredentialModel r : realm.getRequiredCredentials()) { + if (r.getType().equals(CredentialRepresentation.PASSWORD)) { + return true; + } + } + return false; + } }