diff --git a/forms/src/main/java/org/keycloak/forms/LoginBean.java b/forms/src/main/java/org/keycloak/forms/LoginBean.java index 02fc10bbe3..4e4184e3ac 100755 --- a/forms/src/main/java/org/keycloak/forms/LoginBean.java +++ b/forms/src/main/java/org/keycloak/forms/LoginBean.java @@ -38,8 +38,6 @@ public class LoginBean { private String password; - private List requiredCredentials; - public LoginBean(RealmBean realm, MultivaluedMap formData){ this.realm = realm; @@ -48,14 +46,6 @@ public class LoginBean { username = formData.getFirst("username"); password = formData.getFirst("password"); } - - requiredCredentials = new LinkedList(); - for (org.keycloak.models.RequiredCredentialModel c : realm.getRealm().getRequiredCredentials()) { - if (c.isInput()) { - requiredCredentials.add(new RequiredCredential(c.getType(), c.isSecret(), c.getFormLabel())); - } - } - } public String getUsername() { @@ -66,10 +56,6 @@ public class LoginBean { return password; } - public List getRequiredCredentials() { - return requiredCredentials; - } - public RealmBean getRealm() { return realm; } diff --git a/forms/src/main/resources/META-INF/resources/forms/theme/default/login.ftl b/forms/src/main/resources/META-INF/resources/forms/theme/default/login.ftl index 07bcf434c5..248f17b964 100755 --- a/forms/src/main/resources/META-INF/resources/forms/theme/default/login.ftl +++ b/forms/src/main/resources/META-INF/resources/forms/theme/default/login.ftl @@ -16,11 +16,9 @@ - <#list login.requiredCredentials as c> -
- -
- +
+ +
diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/actions/RequiredActionTotpSetupTest.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/actions/RequiredActionTotpSetupTest.java index 48291582d4..bd5d7004b6 100755 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/actions/RequiredActionTotpSetupTest.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/actions/RequiredActionTotpSetupTest.java @@ -35,6 +35,7 @@ import org.keycloak.testsuite.pages.AppPage; import org.keycloak.testsuite.pages.AppPage.RequestType; import org.keycloak.testsuite.pages.LoginConfigTotpPage; import org.keycloak.testsuite.pages.LoginPage; +import org.keycloak.testsuite.pages.LoginTotpPage; import org.keycloak.testsuite.pages.RegisterPage; import org.keycloak.testsuite.rule.KeycloakRule; import org.keycloak.testsuite.rule.KeycloakRule.KeycloakSetup; @@ -70,6 +71,9 @@ public class RequiredActionTotpSetupTest { @WebResource protected LoginPage loginPage; + @WebResource + protected LoginTotpPage loginTotpPage; + @WebResource protected LoginConfigTotpPage totpPage; @@ -113,7 +117,8 @@ public class RequiredActionTotpSetupTest { oauth.openLogout(); loginPage.open(); - loginPage.loginTotp("test-user@localhost", "password", totp.generate(totpSecret)); + loginPage.login("test-user@localhost", "password"); + loginTotpPage.login(totp.generate(totpSecret)); Assert.assertEquals(RequestType.AUTH_RESPONSE, appPage.getRequestType()); } @@ -146,7 +151,7 @@ public class RequiredActionTotpSetupTest { Assert.assertFalse(totpPage.isCurrent()); // Login with one-time password - loginPage.loginTotp("setupTotp2", "password2", totp.generate(totpCode)); + loginTotpPage.login(totp.generate(totpCode)); // Open account page accountTotpPage.open(); diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/pages/LoginPage.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/pages/LoginPage.java index dfbaf46c0e..779873fbbf 100644 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/pages/LoginPage.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/pages/LoginPage.java @@ -73,19 +73,6 @@ public class LoginPage extends AbstractPage { cancelButton.click(); } - public void loginTotp(String username, String password, String code) { - usernameInput.clear(); - usernameInput.sendKeys(username); - - passwordInput.clear(); - passwordInput.sendKeys(password); - - totp.clear(); - totp.sendKeys(code); - - submitButton.click(); - } - public String getError() { return loginErrorMessage != null ? loginErrorMessage.getText() : null; }