Search in sources :

Example 1 with AuthenticatorAttachment

use of com.webauthn4j.data.AuthenticatorAttachment in project keycloak by keycloak.

the class WebAuthnPolicySettingsTest method authenticatorAttachment.

@Test
public void authenticatorAttachment() {
    AuthenticatorAttachment attachment = getPolicyPage().getAuthenticatorAttachment();
    assertThat(attachment, nullValue());
    // Cross-platform
    getPolicyPage().setAuthenticatorAttachment(AuthenticatorAttachment.CROSS_PLATFORM);
    getPolicyPage().clickSaveButton();
    attachment = getPolicyPage().getAuthenticatorAttachment();
    assertThat(attachment, notNullValue());
    assertThat(attachment, is(AuthenticatorAttachment.CROSS_PLATFORM));
    // Platform
    getPolicyPage().setAuthenticatorAttachment(AuthenticatorAttachment.PLATFORM);
    getPolicyPage().clickSaveButton();
    attachment = getPolicyPage().getAuthenticatorAttachment();
    assertThat(attachment, notNullValue());
    assertThat(attachment, is(AuthenticatorAttachment.PLATFORM));
    assertDataAfterModification(AuthenticatorAttachment.PLATFORM.getValue(), DEFAULT_WEBAUTHN_POLICY_NOT_SPECIFIED, WebAuthnRealmData::getAuthenticatorAttachment, (builder) -> builder.authenticatorAttachment(null));
}
Also used : AuthenticatorAttachment(com.webauthn4j.data.AuthenticatorAttachment) WebAuthnRealmData(org.keycloak.testsuite.webauthn.utils.WebAuthnRealmData) AbstractConsoleTest(org.keycloak.testsuite.console.AbstractConsoleTest) Test(org.junit.Test)

Aggregations

AuthenticatorAttachment (com.webauthn4j.data.AuthenticatorAttachment)1 Test (org.junit.Test)1 AbstractConsoleTest (org.keycloak.testsuite.console.AbstractConsoleTest)1 WebAuthnRealmData (org.keycloak.testsuite.webauthn.utils.WebAuthnRealmData)1