Search in sources :

Example 1 with Either

use of com.yubico.util.Either in project java-webauthn-server by Yubico.

the class WebAuthnServer method startRegistration.

public Either<String, RegistrationRequest> startRegistration(@NonNull String username, @NonNull String displayName, Optional<String> credentialNickname, ResidentKeyRequirement residentKeyRequirement, Optional<ByteArray> sessionToken) throws ExecutionException {
    logger.trace("startRegistration username: {}, credentialNickname: {}", username, credentialNickname);
    final Collection<CredentialRegistration> registrations = userStorage.getRegistrationsByUsername(username);
    final Optional<UserIdentity> existingUser = registrations.stream().findAny().map(CredentialRegistration::getUserIdentity);
    final boolean permissionGranted = existingUser.map(userIdentity -> sessions.isSessionForUser(userIdentity.getId(), sessionToken)).orElse(true);
    if (permissionGranted) {
        final UserIdentity registrationUserId = existingUser.orElseGet(() -> UserIdentity.builder().name(username).displayName(displayName).id(generateRandom(32)).build());
        RegistrationRequest request = new RegistrationRequest(username, credentialNickname, generateRandom(32), rp.startRegistration(StartRegistrationOptions.builder().user(registrationUserId).authenticatorSelection(AuthenticatorSelectionCriteria.builder().residentKey(residentKeyRequirement).build()).build()), Optional.of(sessions.createSession(registrationUserId.getId())));
        registerRequestStorage.put(request.getRequestId(), request);
        return Either.right(request);
    } else {
        return Either.left("The username \"" + username + "\" is already registered.");
    }
}
Also used : AppId(com.yubico.webauthn.extension.appid.AppId) X509Certificate(java.security.cert.X509Certificate) Arrays(java.util.Arrays) U2fRegistrationResult(demo.webauthn.data.U2fRegistrationResult) SortedSet(java.util.SortedSet) AuthenticatorData(com.yubico.webauthn.data.AuthenticatorData) LoggerFactory(org.slf4j.LoggerFactory) AuthenticatorSelectionCriteria(com.yubico.webauthn.data.AuthenticatorSelectionCriteria) JacksonCodecs(com.yubico.internal.util.JacksonCodecs) Either(com.yubico.util.Either) FinishRegistrationOptions(com.yubico.webauthn.FinishRegistrationOptions) COSEAlgorithmIdentifier(com.yubico.webauthn.data.COSEAlgorithmIdentifier) SecureRandom(java.security.SecureRandom) PublicKeyCredentialDescriptor(com.yubico.webauthn.data.PublicKeyCredentialDescriptor) CredentialRegistration(demo.webauthn.data.CredentialRegistration) RegistrationRequest(demo.webauthn.data.RegistrationRequest) U2fRegistrationResponse(demo.webauthn.data.U2fRegistrationResponse) Map(java.util.Map) FidoMetadataDownloaderException(com.yubico.fido.metadata.FidoMetadataDownloaderException) DigestException(java.security.DigestException) JsonSerializer(com.fasterxml.jackson.databind.JsonSerializer) InvalidAppIdException(com.yubico.webauthn.extension.appid.InvalidAppIdException) JsonNode(com.fasterxml.jackson.databind.JsonNode) UnexpectedLegalHeader(com.yubico.fido.metadata.UnexpectedLegalHeader) RelyingPartyIdentity(com.yubico.webauthn.data.RelyingPartyIdentity) CertPathValidatorException(java.security.cert.CertPathValidatorException) StartAssertionOptions(com.yubico.webauthn.StartAssertionOptions) AuthenticatorTransport(com.yubico.webauthn.data.AuthenticatorTransport) RegistrationFailedException(com.yubico.webauthn.exception.RegistrationFailedException) NonNull(lombok.NonNull) SignatureException(java.security.SignatureException) Collection(java.util.Collection) Set(java.util.Set) AssertionRequestWrapper(demo.webauthn.data.AssertionRequestWrapper) List(java.util.List) ResidentKeyRequirement(com.yubico.webauthn.data.ResidentKeyRequirement) CertificateParser(com.yubico.internal.util.CertificateParser) AssertionResponse(demo.webauthn.data.AssertionResponse) NoSuchAlgorithmException(java.security.NoSuchAlgorithmException) Optional(java.util.Optional) InvalidKeyException(java.security.InvalidKeyException) CacheBuilder(com.google.common.cache.CacheBuilder) ByteArray(com.yubico.webauthn.data.ByteArray) AssertionResult(com.yubico.webauthn.AssertionResult) JsonGenerator(com.fasterxml.jackson.core.JsonGenerator) HashMap(java.util.HashMap) Attestation(com.yubico.webauthn.attestation.Attestation) Supplier(java.util.function.Supplier) TreeSet(java.util.TreeSet) InvalidAlgorithmParameterException(java.security.InvalidAlgorithmParameterException) Value(lombok.Value) AssertionFailedException(com.yubico.webauthn.exception.AssertionFailedException) StartRegistrationOptions(com.yubico.webauthn.StartRegistrationOptions) RegistrationResponse(demo.webauthn.data.RegistrationResponse) FinishAssertionOptions(com.yubico.webauthn.FinishAssertionOptions) JsonSerialize(com.fasterxml.jackson.databind.annotation.JsonSerialize) RelyingParty(com.yubico.webauthn.RelyingParty) UserIdentity(com.yubico.webauthn.data.UserIdentity) SerializerProvider(com.fasterxml.jackson.databind.SerializerProvider) RegisteredCredential(com.yubico.webauthn.RegisteredCredential) Logger(org.slf4j.Logger) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) CBORObject(com.upokecenter.cbor.CBORObject) IOException(java.io.IOException) CertificateException(java.security.cert.CertificateException) U2fVerifier(com.yubico.webauthn.U2fVerifier) ExecutionException(java.util.concurrent.ExecutionException) TimeUnit(java.util.concurrent.TimeUnit) ExceptionUtil(com.yubico.internal.util.ExceptionUtil) Base64UrlException(com.yubico.webauthn.data.exception.Base64UrlException) Clock(java.time.Clock) RegistrationResult(com.yubico.webauthn.RegistrationResult) AttestationConveyancePreference(com.yubico.webauthn.data.AttestationConveyancePreference) Cache(com.google.common.cache.Cache) AllArgsConstructor(lombok.AllArgsConstructor) Collections(java.util.Collections) YubicoJsonMetadataService(com.yubico.webauthn.attestation.YubicoJsonMetadataService) CredentialRegistration(demo.webauthn.data.CredentialRegistration) UserIdentity(com.yubico.webauthn.data.UserIdentity) RegistrationRequest(demo.webauthn.data.RegistrationRequest)

Example 2 with Either

use of com.yubico.util.Either in project java-webauthn-server by Yubico.

the class WebAuthnServer method finishRegistration.

public Either<List<String>, SuccessfulRegistrationResult> finishRegistration(String responseJson) {
    logger.trace("finishRegistration responseJson: {}", responseJson);
    RegistrationResponse response = null;
    try {
        response = jsonMapper.readValue(responseJson, RegistrationResponse.class);
    } catch (IOException e) {
        logger.error("JSON error in finishRegistration; responseJson: {}", responseJson, e);
        return Either.left(Arrays.asList("Registration failed!", "Failed to decode response object.", e.getMessage()));
    }
    RegistrationRequest request = registerRequestStorage.getIfPresent(response.getRequestId());
    registerRequestStorage.invalidate(response.getRequestId());
    if (request == null) {
        logger.debug("fail finishRegistration responseJson: {}", responseJson);
        return Either.left(Arrays.asList("Registration failed!", "No such registration in progress."));
    } else {
        try {
            com.yubico.webauthn.RegistrationResult registration = rp.finishRegistration(FinishRegistrationOptions.builder().request(request.getPublicKeyCredentialCreationOptions()).response(response.getCredential()).build());
            if (userStorage.userExists(request.getUsername())) {
                boolean permissionGranted = false;
                final boolean isValidSession = request.getSessionToken().map(token -> sessions.isSessionForUser(request.getPublicKeyCredentialCreationOptions().getUser().getId(), token)).orElse(false);
                logger.debug("Session token: {}", request.getSessionToken());
                logger.debug("Valid session: {}", isValidSession);
                if (isValidSession) {
                    permissionGranted = true;
                    logger.info("Session token accepted for user {}", request.getPublicKeyCredentialCreationOptions().getUser().getId());
                }
                logger.debug("permissionGranted: {}", permissionGranted);
                if (!permissionGranted) {
                    throw new RegistrationFailedException(new IllegalArgumentException(String.format("User %s already exists", request.getUsername())));
                }
            }
            return Either.right(new SuccessfulRegistrationResult(request, response, addRegistration(request.getPublicKeyCredentialCreationOptions().getUser(), request.getCredentialNickname(), registration), registration.isAttestationTrusted(), sessions.createSession(request.getPublicKeyCredentialCreationOptions().getUser().getId())));
        } catch (RegistrationFailedException e) {
            logger.debug("fail finishRegistration responseJson: {}", responseJson, e);
            return Either.left(Arrays.asList("Registration failed!", e.getMessage()));
        } catch (Exception e) {
            logger.error("fail finishRegistration responseJson: {}", responseJson, e);
            return Either.left(Arrays.asList("Registration failed unexpectedly; this is likely a bug.", e.getMessage()));
        }
    }
}
Also used : AppId(com.yubico.webauthn.extension.appid.AppId) X509Certificate(java.security.cert.X509Certificate) Arrays(java.util.Arrays) U2fRegistrationResult(demo.webauthn.data.U2fRegistrationResult) SortedSet(java.util.SortedSet) AuthenticatorData(com.yubico.webauthn.data.AuthenticatorData) LoggerFactory(org.slf4j.LoggerFactory) AuthenticatorSelectionCriteria(com.yubico.webauthn.data.AuthenticatorSelectionCriteria) JacksonCodecs(com.yubico.internal.util.JacksonCodecs) Either(com.yubico.util.Either) FinishRegistrationOptions(com.yubico.webauthn.FinishRegistrationOptions) COSEAlgorithmIdentifier(com.yubico.webauthn.data.COSEAlgorithmIdentifier) SecureRandom(java.security.SecureRandom) PublicKeyCredentialDescriptor(com.yubico.webauthn.data.PublicKeyCredentialDescriptor) CredentialRegistration(demo.webauthn.data.CredentialRegistration) RegistrationRequest(demo.webauthn.data.RegistrationRequest) U2fRegistrationResponse(demo.webauthn.data.U2fRegistrationResponse) Map(java.util.Map) FidoMetadataDownloaderException(com.yubico.fido.metadata.FidoMetadataDownloaderException) DigestException(java.security.DigestException) JsonSerializer(com.fasterxml.jackson.databind.JsonSerializer) InvalidAppIdException(com.yubico.webauthn.extension.appid.InvalidAppIdException) JsonNode(com.fasterxml.jackson.databind.JsonNode) UnexpectedLegalHeader(com.yubico.fido.metadata.UnexpectedLegalHeader) RelyingPartyIdentity(com.yubico.webauthn.data.RelyingPartyIdentity) CertPathValidatorException(java.security.cert.CertPathValidatorException) StartAssertionOptions(com.yubico.webauthn.StartAssertionOptions) AuthenticatorTransport(com.yubico.webauthn.data.AuthenticatorTransport) RegistrationFailedException(com.yubico.webauthn.exception.RegistrationFailedException) NonNull(lombok.NonNull) SignatureException(java.security.SignatureException) Collection(java.util.Collection) Set(java.util.Set) AssertionRequestWrapper(demo.webauthn.data.AssertionRequestWrapper) List(java.util.List) ResidentKeyRequirement(com.yubico.webauthn.data.ResidentKeyRequirement) CertificateParser(com.yubico.internal.util.CertificateParser) AssertionResponse(demo.webauthn.data.AssertionResponse) NoSuchAlgorithmException(java.security.NoSuchAlgorithmException) Optional(java.util.Optional) InvalidKeyException(java.security.InvalidKeyException) CacheBuilder(com.google.common.cache.CacheBuilder) ByteArray(com.yubico.webauthn.data.ByteArray) AssertionResult(com.yubico.webauthn.AssertionResult) JsonGenerator(com.fasterxml.jackson.core.JsonGenerator) HashMap(java.util.HashMap) Attestation(com.yubico.webauthn.attestation.Attestation) Supplier(java.util.function.Supplier) TreeSet(java.util.TreeSet) InvalidAlgorithmParameterException(java.security.InvalidAlgorithmParameterException) Value(lombok.Value) AssertionFailedException(com.yubico.webauthn.exception.AssertionFailedException) StartRegistrationOptions(com.yubico.webauthn.StartRegistrationOptions) RegistrationResponse(demo.webauthn.data.RegistrationResponse) FinishAssertionOptions(com.yubico.webauthn.FinishAssertionOptions) JsonSerialize(com.fasterxml.jackson.databind.annotation.JsonSerialize) RelyingParty(com.yubico.webauthn.RelyingParty) UserIdentity(com.yubico.webauthn.data.UserIdentity) SerializerProvider(com.fasterxml.jackson.databind.SerializerProvider) RegisteredCredential(com.yubico.webauthn.RegisteredCredential) Logger(org.slf4j.Logger) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) CBORObject(com.upokecenter.cbor.CBORObject) IOException(java.io.IOException) CertificateException(java.security.cert.CertificateException) U2fVerifier(com.yubico.webauthn.U2fVerifier) ExecutionException(java.util.concurrent.ExecutionException) TimeUnit(java.util.concurrent.TimeUnit) ExceptionUtil(com.yubico.internal.util.ExceptionUtil) Base64UrlException(com.yubico.webauthn.data.exception.Base64UrlException) Clock(java.time.Clock) RegistrationResult(com.yubico.webauthn.RegistrationResult) AttestationConveyancePreference(com.yubico.webauthn.data.AttestationConveyancePreference) Cache(com.google.common.cache.Cache) AllArgsConstructor(lombok.AllArgsConstructor) Collections(java.util.Collections) YubicoJsonMetadataService(com.yubico.webauthn.attestation.YubicoJsonMetadataService) RegistrationFailedException(com.yubico.webauthn.exception.RegistrationFailedException) IOException(java.io.IOException) RegistrationResult(com.yubico.webauthn.RegistrationResult) U2fRegistrationResponse(demo.webauthn.data.U2fRegistrationResponse) RegistrationResponse(demo.webauthn.data.RegistrationResponse) RegistrationRequest(demo.webauthn.data.RegistrationRequest) FidoMetadataDownloaderException(com.yubico.fido.metadata.FidoMetadataDownloaderException) DigestException(java.security.DigestException) InvalidAppIdException(com.yubico.webauthn.extension.appid.InvalidAppIdException) CertPathValidatorException(java.security.cert.CertPathValidatorException) RegistrationFailedException(com.yubico.webauthn.exception.RegistrationFailedException) SignatureException(java.security.SignatureException) NoSuchAlgorithmException(java.security.NoSuchAlgorithmException) InvalidKeyException(java.security.InvalidKeyException) InvalidAlgorithmParameterException(java.security.InvalidAlgorithmParameterException) AssertionFailedException(com.yubico.webauthn.exception.AssertionFailedException) IOException(java.io.IOException) CertificateException(java.security.cert.CertificateException) ExecutionException(java.util.concurrent.ExecutionException) Base64UrlException(com.yubico.webauthn.data.exception.Base64UrlException)

Example 3 with Either

use of com.yubico.util.Either in project cas by apereo.

the class WebAuthnServer method finishRegistration.

public Either<List<String>, SuccessfulRegistrationResult> finishRegistration(final String responseJson) {
    LOGGER.trace("finishRegistration responseJson: {}", responseJson);
    RegistrationResponse response = null;
    try {
        response = jsonMapper.readValue(responseJson, RegistrationResponse.class);
    } catch (final IOException e) {
        LOGGER.error("JSON error in finishRegistration; responseJson: {}", responseJson, e);
        return Either.left(Arrays.asList("Registration failed!", "Failed to decode response object.", e.getMessage()));
    }
    val request = registerRequestStorage.getIfPresent(response.getRequestId());
    registerRequestStorage.invalidate(response.getRequestId());
    if (request == null) {
        LOGGER.debug("fail finishRegistration responseJson: {}", responseJson);
        return Either.left(Arrays.asList("Registration failed!", "No such registration in progress."));
    } else {
        try {
            val registration = rp.finishRegistration(FinishRegistrationOptions.builder().request(request.getPublicKeyCredentialCreationOptions()).response(response.getCredential()).build());
            if (userStorage.userExists(request.getUsername())) {
                var permissionGranted = false;
                val isValidSession = request.getSessionToken().map(token -> sessions.isSessionForUser(request.getPublicKeyCredentialCreationOptions().getUser().getId(), token)).orElse(false);
                LOGGER.debug("Session token: {}", request.getSessionToken());
                LOGGER.debug("Valid session: {}", isValidSession);
                if (isValidSession) {
                    permissionGranted = true;
                    LOGGER.info("Session token accepted for user {}", request.getPublicKeyCredentialCreationOptions().getUser().getId());
                }
                LOGGER.debug("permissionGranted: {}", permissionGranted);
                if (!permissionGranted) {
                    throw new RegistrationFailedException(new IllegalArgumentException(String.format("User %s already exists", request.getUsername())));
                }
            }
            return Either.right(new SuccessfulRegistrationResult(request, response, addRegistration(request.getPublicKeyCredentialCreationOptions().getUser(), request.getCredentialNickname(), registration), registration.isAttestationTrusted(), sessions.createSession(request.getPublicKeyCredentialCreationOptions().getUser().getId())));
        } catch (final RegistrationFailedException e) {
            LOGGER.debug("fail finishRegistration responseJson: {}", responseJson, e);
            return Either.left(Arrays.asList("Registration failed", e.getMessage()));
        } catch (final Exception e) {
            LOGGER.error("fail finishRegistration responseJson: {}", responseJson, e);
            return Either.left(Arrays.asList("Registration failed unexpectedly; this is likely a bug.", e.getMessage()));
        }
    }
}
Also used : lombok.val(lombok.val) X509Certificate(java.security.cert.X509Certificate) RandomUtils(org.apereo.cas.util.RandomUtils) Arrays(java.util.Arrays) SortedSet(java.util.SortedSet) AuthenticatorData(com.yubico.webauthn.data.AuthenticatorData) CredentialRegistration(com.yubico.data.CredentialRegistration) AuthenticatorSelectionCriteria(com.yubico.webauthn.data.AuthenticatorSelectionCriteria) JacksonCodecs(com.yubico.internal.util.JacksonCodecs) Either(com.yubico.util.Either) FinishRegistrationOptions(com.yubico.webauthn.FinishRegistrationOptions) SecureRandom(java.security.SecureRandom) JsonSerializer(com.fasterxml.jackson.databind.JsonSerializer) JsonNode(com.fasterxml.jackson.databind.JsonNode) StartAssertionOptions(com.yubico.webauthn.StartAssertionOptions) AuthenticatorTransport(com.yubico.webauthn.data.AuthenticatorTransport) AssertionResponse(com.yubico.data.AssertionResponse) RegistrationFailedException(com.yubico.webauthn.exception.RegistrationFailedException) NonNull(lombok.NonNull) Collection(java.util.Collection) RegistrationRequest(com.yubico.data.RegistrationRequest) Slf4j(lombok.extern.slf4j.Slf4j) List(java.util.List) ResidentKeyRequirement(com.yubico.webauthn.data.ResidentKeyRequirement) CertificateParser(com.yubico.internal.util.CertificateParser) AttestationMetadataSource(com.yubico.webauthn.attestation.AttestationMetadataSource) Optional(java.util.Optional) ByteArray(com.yubico.webauthn.data.ByteArray) Setter(lombok.Setter) JsonGenerator(com.fasterxml.jackson.core.JsonGenerator) Attestation(com.yubico.webauthn.attestation.Attestation) TreeSet(java.util.TreeSet) Value(lombok.Value) AssertionFailedException(com.yubico.webauthn.exception.AssertionFailedException) StartRegistrationOptions(com.yubico.webauthn.StartRegistrationOptions) FinishAssertionOptions(com.yubico.webauthn.FinishAssertionOptions) JsonSerialize(com.fasterxml.jackson.databind.annotation.JsonSerialize) RelyingParty(com.yubico.webauthn.RelyingParty) UserIdentity(com.yubico.webauthn.data.UserIdentity) SerializerProvider(com.fasterxml.jackson.databind.SerializerProvider) RegistrationResponse(com.yubico.data.RegistrationResponse) RegisteredCredential(com.yubico.webauthn.RegisteredCredential) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) lombok.val(lombok.val) IOException(java.io.IOException) CertificateException(java.security.cert.CertificateException) ExecutionException(java.util.concurrent.ExecutionException) Clock(java.time.Clock) RegistrationResult(com.yubico.webauthn.RegistrationResult) Cache(com.google.common.cache.Cache) AllArgsConstructor(lombok.AllArgsConstructor) Collections(java.util.Collections) AssertionRequestWrapper(com.yubico.data.AssertionRequestWrapper) RegistrationFailedException(com.yubico.webauthn.exception.RegistrationFailedException) IOException(java.io.IOException) RegistrationResponse(com.yubico.data.RegistrationResponse) RegistrationFailedException(com.yubico.webauthn.exception.RegistrationFailedException) AssertionFailedException(com.yubico.webauthn.exception.AssertionFailedException) IOException(java.io.IOException) CertificateException(java.security.cert.CertificateException) ExecutionException(java.util.concurrent.ExecutionException)

Example 4 with Either

use of com.yubico.util.Either in project cas by apereo.

the class WebAuthnServer method startRegistration.

public Either<String, RegistrationRequest> startRegistration(@NonNull final String username, final Optional<String> displayName, final Optional<String> credentialNickname, final ResidentKeyRequirement residentKeyRequirement, final Optional<ByteArray> sessionToken) throws ExecutionException {
    LOGGER.trace("startRegistration username: {}, credentialNickname: {}", username, credentialNickname);
    var registrations = userStorage.getRegistrationsByUsername(username);
    var existingUser = registrations.stream().findAny().map(CredentialRegistration::getUserIdentity);
    val permissionGranted = existingUser.map(userIdentity -> sessions.isSessionForUser(userIdentity.getId(), sessionToken)).orElse(true);
    if (permissionGranted) {
        var registrationUserId = existingUser.orElseGet(() -> UserIdentity.builder().name(username).displayName(displayName.get()).id(generateRandom(32)).build());
        val request = new RegistrationRequest(username, credentialNickname, generateRandom(32), rp.startRegistration(StartRegistrationOptions.builder().user(registrationUserId).authenticatorSelection(AuthenticatorSelectionCriteria.builder().residentKey(residentKeyRequirement).build()).build()), Optional.of(sessions.createSession(registrationUserId.getId())));
        registerRequestStorage.put(request.getRequestId(), request);
        return Either.right(request);
    } else {
        return Either.left("The username \"" + username + "\" is already registered.");
    }
}
Also used : lombok.val(lombok.val) X509Certificate(java.security.cert.X509Certificate) RandomUtils(org.apereo.cas.util.RandomUtils) Arrays(java.util.Arrays) SortedSet(java.util.SortedSet) AuthenticatorData(com.yubico.webauthn.data.AuthenticatorData) CredentialRegistration(com.yubico.data.CredentialRegistration) AuthenticatorSelectionCriteria(com.yubico.webauthn.data.AuthenticatorSelectionCriteria) JacksonCodecs(com.yubico.internal.util.JacksonCodecs) Either(com.yubico.util.Either) FinishRegistrationOptions(com.yubico.webauthn.FinishRegistrationOptions) SecureRandom(java.security.SecureRandom) JsonSerializer(com.fasterxml.jackson.databind.JsonSerializer) JsonNode(com.fasterxml.jackson.databind.JsonNode) StartAssertionOptions(com.yubico.webauthn.StartAssertionOptions) AuthenticatorTransport(com.yubico.webauthn.data.AuthenticatorTransport) AssertionResponse(com.yubico.data.AssertionResponse) RegistrationFailedException(com.yubico.webauthn.exception.RegistrationFailedException) NonNull(lombok.NonNull) Collection(java.util.Collection) RegistrationRequest(com.yubico.data.RegistrationRequest) Slf4j(lombok.extern.slf4j.Slf4j) List(java.util.List) ResidentKeyRequirement(com.yubico.webauthn.data.ResidentKeyRequirement) CertificateParser(com.yubico.internal.util.CertificateParser) AttestationMetadataSource(com.yubico.webauthn.attestation.AttestationMetadataSource) Optional(java.util.Optional) ByteArray(com.yubico.webauthn.data.ByteArray) Setter(lombok.Setter) JsonGenerator(com.fasterxml.jackson.core.JsonGenerator) Attestation(com.yubico.webauthn.attestation.Attestation) TreeSet(java.util.TreeSet) Value(lombok.Value) AssertionFailedException(com.yubico.webauthn.exception.AssertionFailedException) StartRegistrationOptions(com.yubico.webauthn.StartRegistrationOptions) FinishAssertionOptions(com.yubico.webauthn.FinishAssertionOptions) JsonSerialize(com.fasterxml.jackson.databind.annotation.JsonSerialize) RelyingParty(com.yubico.webauthn.RelyingParty) UserIdentity(com.yubico.webauthn.data.UserIdentity) SerializerProvider(com.fasterxml.jackson.databind.SerializerProvider) RegistrationResponse(com.yubico.data.RegistrationResponse) RegisteredCredential(com.yubico.webauthn.RegisteredCredential) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) lombok.val(lombok.val) IOException(java.io.IOException) CertificateException(java.security.cert.CertificateException) ExecutionException(java.util.concurrent.ExecutionException) Clock(java.time.Clock) RegistrationResult(com.yubico.webauthn.RegistrationResult) Cache(com.google.common.cache.Cache) AllArgsConstructor(lombok.AllArgsConstructor) Collections(java.util.Collections) AssertionRequestWrapper(com.yubico.data.AssertionRequestWrapper) CredentialRegistration(com.yubico.data.CredentialRegistration) RegistrationRequest(com.yubico.data.RegistrationRequest)

Aggregations

JsonGenerator (com.fasterxml.jackson.core.JsonGenerator)4 JsonNode (com.fasterxml.jackson.databind.JsonNode)4 JsonSerializer (com.fasterxml.jackson.databind.JsonSerializer)4 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)4 SerializerProvider (com.fasterxml.jackson.databind.SerializerProvider)4 JsonSerialize (com.fasterxml.jackson.databind.annotation.JsonSerialize)4 Cache (com.google.common.cache.Cache)4 CertificateParser (com.yubico.internal.util.CertificateParser)4 JacksonCodecs (com.yubico.internal.util.JacksonCodecs)4 Either (com.yubico.util.Either)4 FinishAssertionOptions (com.yubico.webauthn.FinishAssertionOptions)4 FinishRegistrationOptions (com.yubico.webauthn.FinishRegistrationOptions)4 RegisteredCredential (com.yubico.webauthn.RegisteredCredential)4 RegistrationResult (com.yubico.webauthn.RegistrationResult)4 RelyingParty (com.yubico.webauthn.RelyingParty)4 StartAssertionOptions (com.yubico.webauthn.StartAssertionOptions)4 StartRegistrationOptions (com.yubico.webauthn.StartRegistrationOptions)4 Attestation (com.yubico.webauthn.attestation.Attestation)4 AuthenticatorData (com.yubico.webauthn.data.AuthenticatorData)4 AuthenticatorSelectionCriteria (com.yubico.webauthn.data.AuthenticatorSelectionCriteria)4