KEYCLOAK-12011 Remove cancel button from OTP form (#6511)
* KEYCLOAK-12011 Remove cancel button from OTP form * Remove back button
This commit is contained in:
parent
e2144d6aec
commit
48bddc37ae
5 changed files with 0 additions and 38 deletions
|
@ -59,10 +59,6 @@ public class OTPFormAuthenticator extends AbstractUsernameFormAuthenticator impl
|
||||||
|
|
||||||
public void validateOTP(AuthenticationFlowContext context) {
|
public void validateOTP(AuthenticationFlowContext context) {
|
||||||
MultivaluedMap<String, String> inputData = context.getHttpRequest().getDecodedFormParameters();
|
MultivaluedMap<String, String> inputData = context.getHttpRequest().getDecodedFormParameters();
|
||||||
if (inputData.containsKey("cancel")) {
|
|
||||||
context.resetFlow();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
String otp = inputData.getFirst("otp");
|
String otp = inputData.getFirst("otp");
|
||||||
String credentialId = context.getSelectedCredentialId();
|
String credentialId = context.getSelectedCredentialId();
|
||||||
|
|
|
@ -34,9 +34,6 @@ public class LoginTotpPage extends CredentialsComboboxPage {
|
||||||
@FindBy(css = "input[type=\"submit\"]")
|
@FindBy(css = "input[type=\"submit\"]")
|
||||||
private WebElement submitButton;
|
private WebElement submitButton;
|
||||||
|
|
||||||
@FindBy(id = "kc-cancel")
|
|
||||||
private WebElement cancelButton;
|
|
||||||
|
|
||||||
@FindBy(className = "alert-error")
|
@FindBy(className = "alert-error")
|
||||||
private WebElement loginErrorMessage;
|
private WebElement loginErrorMessage;
|
||||||
|
|
||||||
|
@ -47,10 +44,6 @@ public class LoginTotpPage extends CredentialsComboboxPage {
|
||||||
submitButton.click();
|
submitButton.click();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void cancel() {
|
|
||||||
cancelButton.click();
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getError() {
|
public String getError() {
|
||||||
return loginErrorMessage != null ? loginErrorMessage.getText() : null;
|
return loginErrorMessage != null ? loginErrorMessage.getText() : null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -377,21 +377,6 @@ public class BruteForceTest extends AbstractTestRealmKeycloakTest {
|
||||||
continueLoginWithTotp();
|
continueLoginWithTotp();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testTotpGoingBack() throws Exception {
|
|
||||||
loginPage.open();
|
|
||||||
loginPage.login("test-user@localhost", "password");
|
|
||||||
|
|
||||||
continueLoginWithInvalidTotp();
|
|
||||||
loginTotpPage.cancel();
|
|
||||||
loginPage.assertCurrent();
|
|
||||||
loginPage.login("test-user@localhost", "password");
|
|
||||||
continueLoginWithInvalidTotp();
|
|
||||||
continueLoginWithCorrectTotpExpectFailure();
|
|
||||||
clearUserFailures();
|
|
||||||
continueLoginWithTotp();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testBrowserMissingTotp() throws Exception {
|
public void testBrowserMissingTotp() throws Exception {
|
||||||
loginSuccess();
|
loginSuccess();
|
||||||
|
|
|
@ -147,16 +147,6 @@ public class LoginTotpTest extends AbstractTestRealmKeycloakTest {
|
||||||
events.expectLogin().assertEvent();
|
events.expectLogin().assertEvent();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
public void loginWithTotpCancel() throws Exception {
|
|
||||||
loginPage.open();
|
|
||||||
loginPage.login("test-user@localhost", "password");
|
|
||||||
|
|
||||||
Assert.assertTrue(loginTotpPage.isCurrent());
|
|
||||||
loginTotpPage.cancel();
|
|
||||||
loginPage.assertCurrent();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void loginWithTotpInvalidPassword() throws Exception {
|
public void loginWithTotpInvalidPassword() throws Exception {
|
||||||
loginPage.open();
|
loginPage.open();
|
||||||
|
|
|
@ -25,8 +25,6 @@
|
||||||
<input type="hidden" id="id-hidden-input" name="credentialId" <#if auth.selectedCredential?has_content>value="${auth.selectedCredential}"</#if>/>
|
<input type="hidden" id="id-hidden-input" name="credentialId" <#if auth.selectedCredential?has_content>value="${auth.selectedCredential}"</#if>/>
|
||||||
<input class="${properties.kcButtonClass!} ${properties.kcButtonPrimaryClass!} ${properties.kcButtonBlockClass!} ${properties.kcButtonLargeClass!}"
|
<input class="${properties.kcButtonClass!} ${properties.kcButtonPrimaryClass!} ${properties.kcButtonBlockClass!} ${properties.kcButtonLargeClass!}"
|
||||||
name="login" id="kc-login" type="submit" value="${msg("doLogIn")}"/>
|
name="login" id="kc-login" type="submit" value="${msg("doLogIn")}"/>
|
||||||
<input class="${properties.kcButtonClass!} ${properties.kcButtonDefaultClass!} ${properties.kcButtonBlockClass!} ${properties.kcButtonLargeClass!}"
|
|
||||||
name="cancel" id="kc-cancel" type="submit" value="${msg("doCancel")}"/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
Loading…
Reference in a new issue