Search in sources :

Example 6 with CoreServerProperty

use of com.webauthn4j.server.CoreServerProperty in project webauthn4j by webauthn4j.

the class CoreAuthenticationParametersTest method constructor_without_allowCredentials_test.

@Deprecated
@Test
void constructor_without_allowCredentials_test() {
    // Server properties
    String rpId = "example.com";
    Challenge challenge = new DefaultChallenge();
    CoreServerProperty serverProperty = new CoreServerProperty(rpId, challenge);
    Authenticator authenticator = mock(Authenticator.class);
    CoreAuthenticationParameters instance = new CoreAuthenticationParameters(serverProperty, authenticator, false, true);
    assertThat(instance.getServerProperty()).isEqualTo(serverProperty);
    assertThat(instance.getAuthenticator()).isEqualTo(authenticator);
    assertThat(instance.getAllowCredentials()).isNull();
    assertThat(instance.isUserVerificationRequired()).isFalse();
    assertThat(instance.isUserPresenceRequired()).isTrue();
}
Also used : DefaultChallenge(com.webauthn4j.data.client.challenge.DefaultChallenge) CoreServerProperty(com.webauthn4j.server.CoreServerProperty) Authenticator(com.webauthn4j.authenticator.Authenticator) Challenge(com.webauthn4j.data.client.challenge.Challenge) DefaultChallenge(com.webauthn4j.data.client.challenge.DefaultChallenge) Test(org.junit.jupiter.api.Test)

Example 7 with CoreServerProperty

use of com.webauthn4j.server.CoreServerProperty in project webauthn4j by webauthn4j.

the class CoreRegistrationParametersTest method constructor_without_pubKeyCredParams_test.

@Deprecated
@Test
void constructor_without_pubKeyCredParams_test() {
    // Server properties
    String rpId = "example.com";
    Challenge challenge = new DefaultChallenge();
    CoreServerProperty serverProperty = new CoreServerProperty(rpId, challenge);
    CoreRegistrationParameters instance = new CoreRegistrationParameters(serverProperty, false, true);
    assertThat(instance.getServerProperty()).isEqualTo(serverProperty);
    assertThat(instance.getPubKeyCredParams()).isNull();
    assertThat(instance.isUserVerificationRequired()).isFalse();
    assertThat(instance.isUserPresenceRequired()).isTrue();
}
Also used : DefaultChallenge(com.webauthn4j.data.client.challenge.DefaultChallenge) CoreServerProperty(com.webauthn4j.server.CoreServerProperty) Challenge(com.webauthn4j.data.client.challenge.Challenge) DefaultChallenge(com.webauthn4j.data.client.challenge.DefaultChallenge) Test(org.junit.jupiter.api.Test)

Example 8 with CoreServerProperty

use of com.webauthn4j.server.CoreServerProperty in project webauthn4j by webauthn4j.

the class CoreRegistrationParametersTest method constructor_without_pubKeyCredParams_userPresenceRequired_test.

@Deprecated
@Test
void constructor_without_pubKeyCredParams_userPresenceRequired_test() {
    // Server properties
    String rpId = "example.com";
    Challenge challenge = new DefaultChallenge();
    CoreServerProperty serverProperty = new CoreServerProperty(rpId, challenge);
    CoreRegistrationParameters instance = new CoreRegistrationParameters(serverProperty, false);
    assertThat(instance.getServerProperty()).isEqualTo(serverProperty);
    assertThat(instance.getPubKeyCredParams()).isNull();
    assertThat(instance.isUserVerificationRequired()).isFalse();
}
Also used : DefaultChallenge(com.webauthn4j.data.client.challenge.DefaultChallenge) CoreServerProperty(com.webauthn4j.server.CoreServerProperty) Challenge(com.webauthn4j.data.client.challenge.Challenge) DefaultChallenge(com.webauthn4j.data.client.challenge.DefaultChallenge) Test(org.junit.jupiter.api.Test)

Aggregations

CoreServerProperty (com.webauthn4j.server.CoreServerProperty)8 Challenge (com.webauthn4j.data.client.challenge.Challenge)4 DefaultChallenge (com.webauthn4j.data.client.challenge.DefaultChallenge)4 Test (org.junit.jupiter.api.Test)4 CoreAuthenticator (com.webauthn4j.authenticator.CoreAuthenticator)3 AuthenticationExtensionAuthenticatorOutput (com.webauthn4j.data.extension.authenticator.AuthenticationExtensionAuthenticatorOutput)3 Authenticator (com.webauthn4j.authenticator.Authenticator)2 NonNull (org.checkerframework.checker.nullness.qual.NonNull)2 DCAppleDevice (com.webauthn4j.appattest.authenticator.DCAppleDevice)1 DCAppleDeviceImpl (com.webauthn4j.appattest.authenticator.DCAppleDeviceImpl)1 PublicKeyCredentialParameters (com.webauthn4j.data.PublicKeyCredentialParameters)1 AttestationObject (com.webauthn4j.data.attestation.AttestationObject)1 COSEKey (com.webauthn4j.data.attestation.authenticator.COSEKey)1 COSEAlgorithmIdentifier (com.webauthn4j.data.attestation.statement.COSEAlgorithmIdentifier)1 RegistrationExtensionAuthenticatorOutput (com.webauthn4j.data.extension.authenticator.RegistrationExtensionAuthenticatorOutput)1 UserNotPresentException (com.webauthn4j.validator.exception.UserNotPresentException)1 UserNotVerifiedException (com.webauthn4j.validator.exception.UserNotVerifiedException)1