use of org.keycloak.testsuite.webauthn.authenticators.VirtualAuthenticatorManager in project keycloak by keycloak.
the class AbstractWebAuthnVirtualTest method createDefaultVirtualManager.
public static VirtualAuthenticatorManager createDefaultVirtualManager(WebDriver webDriver, VirtualAuthenticatorOptions options) {
VirtualAuthenticatorManager manager = new VirtualAuthenticatorManager(webDriver);
manager.useAuthenticator(options);
return manager;
}
use of org.keycloak.testsuite.webauthn.authenticators.VirtualAuthenticatorManager in project keycloak by keycloak.
the class VirtualAuthenticatorsManagerTest method singleResponsibleAuthOptions.
@Test
public void singleResponsibleAuthOptions() {
VirtualAuthenticatorOptions options = DefaultVirtualAuthOptions.DEFAULT_BLE.getOptions();
options.setTransport(VirtualAuthenticatorOptions.Transport.NFC);
final VirtualAuthenticatorManager manager = new VirtualAuthenticatorManager(driver);
assertThat(manager, notNullValue());
manager.useAuthenticator(options);
assertThat(manager.getCurrent().getOptions().getTransport(), is(VirtualAuthenticatorOptions.Transport.NFC));
options = DefaultVirtualAuthOptions.DEFAULT_BLE.getOptions();
manager.useAuthenticator(options);
assertThat(manager.getCurrent().getOptions().getTransport(), is(VirtualAuthenticatorOptions.Transport.BLE));
}
use of org.keycloak.testsuite.webauthn.authenticators.VirtualAuthenticatorManager in project keycloak by keycloak.
the class VirtualAuthenticatorsManagerTest method addVirtualAuthenticator.
@Test
public void addVirtualAuthenticator() {
final VirtualAuthenticatorManager manager = new VirtualAuthenticatorManager(driver);
assertThat(manager, notNullValue());
KcVirtualAuthenticator authenticator = useDefaultTestingAuthenticator(manager);
assertAuthenticatorOptions(authenticator);
manager.removeAuthenticator();
assertThat(manager.getCurrent(), Matchers.nullValue());
authenticator = useDefaultTestingAuthenticator(manager);
assertAuthenticatorOptions(authenticator);
manager.removeAuthenticator();
assertThat(manager.getCurrent(), Matchers.nullValue());
}
use of org.keycloak.testsuite.webauthn.authenticators.VirtualAuthenticatorManager in project keycloak by keycloak.
the class VirtualAuthenticatorsManagerTest method differentDriver.
@Test
public void differentDriver() {
final VirtualAuthenticatorManager manager = new VirtualAuthenticatorManager(driver);
assertThat(manager, notNullValue());
KcVirtualAuthenticator authenticator = useDefaultTestingAuthenticator(manager);
assertThat(authenticator, notNullValue());
assertThat(manager.getCurrent(), notNullValue());
final VirtualAuthenticatorManager manager2 = new VirtualAuthenticatorManager(driver2);
assertThat(manager2, notNullValue());
assertThat(manager2.getCurrent(), nullValue());
}
use of org.keycloak.testsuite.webauthn.authenticators.VirtualAuthenticatorManager in project keycloak by keycloak.
the class VirtualAuthenticatorsManagerTest method overrideUsedAuthenticator.
@Test
public void overrideUsedAuthenticator() {
final VirtualAuthenticatorManager manager = new VirtualAuthenticatorManager(driver);
assertThat(manager, notNullValue());
KcVirtualAuthenticator defaultTesting = useDefaultTestingAuthenticator(manager);
assertAuthenticatorOptions(defaultTesting);
assertThat(manager.getCurrent(), is(defaultTesting));
VirtualAuthenticatorOptions defaultBleOptions = DefaultVirtualAuthOptions.DEFAULT_BLE.getOptions();
assertThat(defaultBleOptions, notNullValue());
KcVirtualAuthenticator defaultBLE = manager.useAuthenticator(defaultBleOptions);
assertThat(defaultBLE, notNullValue());
assertAuthenticatorOptions(defaultTesting);
assertThat(manager.getCurrent(), is(defaultBLE));
assertThat(manager.getCurrent().getOptions().clone(), is(defaultBleOptions));
}
Aggregations