Java Code Examples for com.webauthn4j.util.Base64UrlUtil#decode()

The following examples show how to use com.webauthn4j.util.Base64UrlUtil#decode() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PackedAttestationStatementValidatorTest.java    From webauthn4j with Apache License 2.0 6 votes vote down vote up
private void validate(byte[] clientDataBytes, AttestationObject attestationObject) {

        byte[] attestationObjectBytes = new AttestationObjectConverter(objectConverter).convertToBytes(attestationObject);

        Origin origin = new Origin(originUrl);
        Challenge challenge = (Challenge) () -> Base64UrlUtil.decode(challengeString);

        CollectedClientData collectedClientData = new CollectedClientDataConverter(objectConverter).convert(clientDataBytes);
        Set<AuthenticatorTransport> transports = Collections.emptySet();
        AuthenticationExtensionsClientOutputs<RegistrationExtensionClientOutput<?>> authenticationExtensionsClientOutputs = new AuthenticationExtensionsClientOutputs<>();

        RegistrationObject registrationObject = new RegistrationObject(
                attestationObject,
                attestationObjectBytes,
                collectedClientData,
                clientDataBytes,
                authenticationExtensionsClientOutputs,
                transports,
                new ServerProperty(origin, rpId, challenge, tokenBindingId)
        );

        validator.validate(registrationObject);
    }
 
Example 2
Source File: TPMAuthenticator.java    From webauthn4j with Apache License 2.0 6 votes vote down vote up
private TPMSAttest createTPMSAttest(AttestationStatementRequest attestationStatementRequest, COSEAlgorithmIdentifier alg, TPMTPublic pubArea) {
    TPMGenerated magic = TPMGenerated.TPM_GENERATED_VALUE;
    TPMISTAttest type = TPMISTAttest.TPM_ST_ATTEST_CERTIFY;
    byte[] qualifiedSigner = Base64UrlUtil.decode("AAu8WfTf2aakLcO4Zq_y3w0Zgmu_AUtnqwrW67F2MGuABw");
    String messageDigestJcaName;
    try {
        SignatureAlgorithm signatureAlgorithm = SignatureAlgorithm.create(alg);
        messageDigestJcaName = signatureAlgorithm.getMessageDigestJcaName();
    } catch (IllegalArgumentException e) {
        throw new WebAuthnModelException("alg is not signature algorithm", e);
    }
    byte[] extraData = MessageDigestUtil.createMessageDigest(messageDigestJcaName).digest(attestationStatementRequest.getSignedData());
    BigInteger clock = BigInteger.valueOf(7270451399L);
    long resetCount = 1749088739L;
    long restartCount = 3639844613L;
    TPMSClockInfo clockInfo = new TPMSClockInfo(clock, resetCount, restartCount, true);
    BigInteger firmwareVersion = new BigInteger("12241000001210926099");
    byte[] nameDigest = MessageDigestUtil.createSHA256().digest(pubArea.getBytes());
    TPMTHA name = new TPMTHA(TPMIAlgHash.TPM_ALG_SHA256, nameDigest);
    byte[] qualifiedNameDigest = Base64UrlUtil.decode("AVI0eQ_AAZjNvrhUEMK2q4wxuwIFOnHIDF0Qljhf47Q");
    TPMTHA qualifiedName = new TPMTHA(TPMIAlgHash.TPM_ALG_SHA256, qualifiedNameDigest);
    TPMUAttest attested = new TPMSCertifyInfo(name, qualifiedName);

    return new TPMSAttest(magic, type, qualifiedSigner, extraData, clockInfo, firmwareVersion, attested);
}
 
Example 3
Source File: AttestationObjectConverterTest.java    From webauthn4j with Apache License 2.0 5 votes vote down vote up
@Test
void convert_AttestationObject_withTPMAttestation_test() {
    String value = "o2NmbXRjdHBtaGF1dGhEYXRhWQFnlWkIjx7O4yMpVANdvRDXyuORMFonUbVZu4_Xy7IpvdRFAAAAAAiYcFjK3EuBtuEw3lDcvpYAIIVs3RYj2zjEOSjQbDIbPmXofBdIkx6x-t2CpK8SRYI0pAEDAzkBACBZAQDF2m9Nk1e94gL1xVjNCjFW0lTy4K2atXkx-YJrdH3hrE8p1gcIdNzleRDhmERJnY5CRwM5sXDQIrUBq4jpwvTtMC5HGccN6-iEJAPtm9_CJzCmGhtw9hbF8bcAys94RhN9xLLUaajhWqtPrYZXCEAi0o9E2QdTIxJrcAfJgZOf33JMr0--R1BAQxpOoGRDC8ss-tfQW9ufZLWw4JUuz4Z5Jz1sbfqBYB8UUDMWoT0HgsMaPmvd7T17xGvB-pvvDf-Dt96vFGtYLEZEgho8Yu26pr5CK_BOQ-2vX9N4MIYVPXNhogMGGmKYqybhM3yhye0GdBpZ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2q4wxuwIFOnHIDF0Qljhf47RncHViQXJlYVkBNgABAAsABgRyACCd_8vzbDg65pn7mGjcbcuJ1xU4hL4oA5IsEkFYv60irgAQABAIAAAAAAABAMXab02TV73iAvXFWM0KMVbSVPLgrZq1eTH5gmt0feGsTynWBwh03OV5EOGYREmdjkJHAzmxcNAitQGriOnC9O0wLkcZxw3r6IQkA-2b38InMKYaG3D2FsXxtwDKz3hGE33EstRpqOFaq0-thlcIQCLSj0TZB1MjEmtwB8mBk5_fckyvT75HUEBDGk6gZEMLyyz619Bb259ktbDglS7PhnknPWxt-oFgHxRQMxahPQeCwxo-a93tPXvEa8H6m-8N_4O33q8Ua1gsRkSCGjxi7bqmvkIr8E5D7a9f03gwhhU9c2GiAwYaYpirJuEzfKHJ7QZ0GlkFR3mI5yAwTq4YnX8";
    byte[] source = Base64UrlUtil.decode(value);
    AttestationObject left = target.convert(source);
    assertThat(left.getAttestationStatement()).isInstanceOf(TPMAttestationStatement.class);
    byte[] result = target.convertToBytes(left);
    target.convert(result);
}
 
Example 4
Source File: AttestationObjectConverterTest.java    From webauthn4j with Apache License 2.0 5 votes vote down vote up
@Test
void extractAuthenticatorData() {
    String value = "o2NmbXRjdHBtaGF1dGhEYXRhWQFnlWkIjx7O4yMpVANdvRDXyuORMFonUbVZu4_Xy7IpvdRFAAAAAAiYcFjK3EuBtuEw3lDcvpYAIIVs3RYj2zjEOSjQbDIbPmXofBdIkx6x-t2CpK8SRYI0pAEDAzkBACBZAQDF2m9Nk1e94gL1xVjNCjFW0lTy4K2atXkx-YJrdH3hrE8p1gcIdNzleRDhmERJnY5CRwM5sXDQIrUBq4jpwvTtMC5HGccN6-iEJAPtm9_CJzCmGhtw9hbF8bcAys94RhN9xLLUaajhWqtPrYZXCEAi0o9E2QdTIxJrcAfJgZOf33JMr0--R1BAQxpOoGRDC8ss-tfQW9ufZLWw4JUuz4Z5Jz1sbfqBYB8UUDMWoT0HgsMaPmvd7T17xGvB-pvvDf-Dt96vFGtYLEZE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QvCSXg7GdAjdWZpXv6D4DH8VYBCE8AIgALAVI0eQ_AAZjNvrhUEMK2q4wxuwIFOnHIDF0Qljhf47RncHViQXJlYVkBNgABAAsABgRyACCd_8vzbDg65pn7mGjcbcuJ1xU4hL4oA5IsEkFYv60irgAQABAIAAAAAAABAMXab02TV73iAvXFWM0KMVbSVPLgrZq1eTH5gmt0feGsTynWBwh03OV5EOGYREmdjkJHAzmxcNAitQGriOnC9O0wLkcZxw3r6IQkA-2b38InMKYaG3D2FsXxtwDKz3hGE33EstRpqOFaq0-thlcIQCLSj0TZB1MjEmtwB8mBk5_fckyvT75HUEBDGk6gZEMLyyz619Bb259ktbDglS7PhnknPWxt-oFgHxRQMxahPQeCwxo-a93tPXvEa8H6m-8N_4O33q8Ua1gsRkSCGjxi7bqmvkIr8E5D7a9f03gwhhU9c2GiAwYaYpirJuEzfKHJ7QZ0GlkFR3mI5yAwTq4YnX8";
    byte[] source = Base64UrlUtil.decode(value);
    byte[] bytes = target.extractAuthenticatorData(source);
    assertThat(bytes).isEqualTo(Base64UrlUtil.decode("lWkIjx7O4yMpVANdvRDXyuORMFonUbVZu4_Xy7IpvdRFAAAAAAiYcFjK3EuBtuEw3lDcvpYAIIVs3RYj2zjEOSjQbDIbPmXofBdIkx6x-t2CpK8SRYI0pAEDAzkBACBZAQDF2m9Nk1e94gL1xVjNCjFW0lTy4K2atXkx-YJrdH3hrE8p1gcIdNzleRDhmERJnY5CRwM5sXDQIrUBq4jpwvTtMC5HGccN6-iEJAPtm9_CJzCmGhtw9hbF8bcAys94RhN9xLLUaajhWqtPrYZXCEAi0o9E2QdTIxJrcAfJgZOf33JMr0--R1BAQxpOoGRDC8ss-tfQW9ufZLWw4JUuz4Z5Jz1sbfqBYB8UUDMWoT0HgsMaPmvd7T17xGvB-pvvDf-Dt96vFGtYLEZEgho8Yu26pr5CK_BOQ-2vX9N4MIYVPXNhogMGGmKYqybhM3yhye0GdBpZBUd5iOcgME6uGJ1_IUMBAAE"));
}
 
Example 5
Source File: AttestationObjectConverterTest.java    From webauthn4j with Apache License 2.0 5 votes vote down vote up
@Test
void convert_AttestationObject_withAndroidSafetyNetAttestation_test() {
    String value = "o2hhdXRoRGF0YVjElWkIjx7O4yMpVANdvRDXyuORMFonUbVZu4_Xy7IpvdRAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQKglxHyfnRKAZVqiJdIqtqf4I9dx0oO6_zAO8TnDojvEZAq2DZkByI1fcoWVQEq_O3FLH5aOwzbrrxrJ65U5dYqlAQIDJiABIVggh5OJfYRDzVGIowKqU57AnoVjjdmmjGi9zlMkjAVV9DAiWCDr0iSi0viIKNPMTIdN28gWNmkcwOr6DQx66MPff3Odm2NmbXRxYW5kcm9pZC1zYWZldHluZXRnYXR0U3RtdKJjdmVyaDEyNjg1MDIzaHJlc3BvbnNlWRSnZXlKaGJHY2lPaUpTVXpJMU5pSXNJbmcxWXlJNld5Sk5TVWxGYVdwRFEwRXpTMmRCZDBsQ1FXZEpTVmxyV1c4MVJqQm5PRFpyZDBSUldVcExiMXBKYUhaalRrRlJSVXhDVVVGM1ZrUkZURTFCYTBkQk1WVkZRbWhOUTFaV1RYaElha0ZqUW1kT1ZrSkJiMVJHVldSMllqSmtjMXBUUWxWamJsWjZaRU5DVkZwWVNqSmhWMDVzWTNwRmJFMURUVWRCTVZWRlFYaE5ZMUl5T1haYU1uaHNTVVZzZFdSSFZubGliVll3U1VWR01XUkhhSFpqYld3d1pWTkNTRTE2UVdWR2R6QjRUbnBGZVUxRVVYaE5la1UwVGtST1lVWjNNSGhQUkVWNVRVUk5kMDFFUVhkTlJFSmhUVWQzZUVONlFVcENaMDVXUWtGWlZFRnNWbFJOVWsxM1JWRlpSRlpSVVVsRVFYQkVXVmQ0Y0ZwdE9YbGliV3hvVFZKWmQwWkJXVVJXVVZGSVJFRXhUbUl6Vm5Wa1IwWndZbWxDVjJGWFZqTk5VazEzUlZGWlJGWlJVVXRFUVhCSVlqSTVibUpIVldkVFZ6VnFUVkp6ZD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blI1WVVSYWNQNmtHR2oyY0Z4c3dFMjkwOHd4djloaVlOS05vamVldThYYzRJdDdQYmhsQXVPN3l3aFFGQTgxaVBDQ0ZtMTFCOGNmVVhiV0E4bF8ydHROUEJFTUdNNi1aNlZ5UQ";
    byte[] source = Base64UrlUtil.decode(value);
    AttestationObject attestationObject = target.convert(source);
    assertThat(attestationObject.getAttestationStatement()).isInstanceOf(AndroidSafetyNetAttestationStatement.class);
    target.convertToBytes(attestationObject);
}
 
Example 6
Source File: AttestationObjectConverterTest.java    From webauthn4j with Apache License 2.0 5 votes vote down vote up
@Test
void convert_AttestationObject_with_AndroidKeyAttestation_test() {
    String testData = "o2NmbXRrYW5kcm9pZC1rZXlnYXR0U3RtdKNjYWxnJmNzaWdYRjBEAiAsp6jPtimcSgc-fgIsVwgqRsZX6eU7KKbkVGWa0CRJlgIgH5yuf_laPyNy4PlS6e8ZHjs57iztxGiTqO7G91sdlWBjeDVjg1kCzjCCAsowggJwoAMCAQICAQEwCgYIKoZIzj0EAwIwgYgxCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApDYWxpZm9ybmlhMRUwEwYDVQQKDAxHb29nbGUsIEluYy4xEDAOBgNVBAsMB0FuZHJvaWQxOzA5BgNVBAMMMkFuZHJvaWQgS2V5c3RvcmUgU29mdHdhcmUgQXR0ZXN0YXRpb24gSW50ZXJtZWRpYXRlMB4XDTE4MTIwMjA5MTAyNVoXDTI4MTIwMjA5MTAyNVowHzEdMBsGA1UEAwwUQW5kcm9pZCBLZXlzdG9yZSBLZXkwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAQ4SaIP3ibDSwCIORpYJ3g9_5OICxZUCIqt-vV6JZVJoXQ8S1JFzyaFz5EFQ2fNT6-5SE5wWTZRAR_A3M52IcaPo4IBMTCCAS0wCwYDVR0PBAQDAgeAMIH8BgorBgEEAdZ5AgERBIHtMIHqAgECCgEAAgEBCgEBBCAqQ4LXu9idi1vfF3LP7MoUOSSHuf1XHy63K9-X3gbU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PK1PJKfnTa9BffG_aGF1dGhEYXRhWMWVaQiPHs7jIylUA129ENfK45EwWidRtVm7j9fLsim91EUAAAAAKPN9K5K4QcSwKoYM73zANABBAVUvAmX241vMKYd7ZBdmkNWaYcNYhoSZCJjFRGmROb6I4ygQUVmH6k9IMwcbZGeAQ4v4WMNphORudwje5h7ty9ClAQIDJiABIVggOEmiD94mw0sAiDkaWCd4Pf-TiAsWVAiKrfr1eiWVSaEiWCB0PEtSRc8mhc-RBUNnzU-vuUhOcFk2UQEfwNzOdiHGjw";
    byte[] source = Base64UrlUtil.decode(testData);
    AttestationObject attestationObject = target.convert(source);
    assertThat(attestationObject.getAttestationStatement()).isInstanceOf(AndroidKeyAttestationStatement.class);
    target.convertToBytes(attestationObject);
}
 
Example 7
Source File: AuthenticatorDataConverterTest.java    From webauthn4j with Apache License 2.0 5 votes vote down vote up
@Test
void deserialize_data_with_surplus_bytes_test() {
    //noinspection SpellCheckingInspection
    String input = "SZYN5YgOjGh0NBcPZHZgW4_krrmihjLHmVzzuoMdl2MBAAABRQ";
    byte[] data = Base64UrlUtil.decode(input);
    byte[] bytes = Arrays.copyOf(data, data.length + 1);
    AuthenticatorDataConverter authenticatorDataConverter = new AuthenticatorDataConverter(objectConverter);
    //When
    assertThrows(DataConversionException.class,
            () -> authenticatorDataConverter.convert(bytes)
    );
}
 
Example 8
Source File: AuthenticatorDataConverterTest.java    From webauthn4j with Apache License 2.0 5 votes vote down vote up
@Test
void convert_too_short_data_test() {
    //Given
    //noinspection SpellCheckingInspection
    byte[] input = Base64UrlUtil.decode("SZYN5YgOjGh0NBcP");
    AuthenticatorDataConverter authenticatorDataConverter = new AuthenticatorDataConverter(objectConverter);

    //When
    assertThrows(DataConversionException.class,
            () -> authenticatorDataConverter.convert(input)
    );
}
 
Example 9
Source File: FidoMdsMetadataItemsProvider.java    From webauthn4j with Apache License 2.0 5 votes vote down vote up
MetadataStatement fetchMetadataStatement(String uri, byte[] expectedHash) {
    String uriWithToken = appendToken(uri, token);
    String metadataStatementBase64url = httpClient.fetch(uriWithToken);
    String metadataStatementStr = new String(Base64UrlUtil.decode(metadataStatementBase64url));
    byte[] hash = MessageDigestUtil.createSHA256().digest(metadataStatementBase64url.getBytes(StandardCharsets.UTF_8));
    if (!Arrays.equals(hash, expectedHash)) {
        throw new MDSException("Hash of metadataStatement doesn't match");
    }
    MetadataStatement metadataStatement = jsonConverter.readValue(metadataStatementStr, MetadataStatement.class);
    metadataStatementValidator.validate(metadataStatement);
    return metadataStatement;
}
 
Example 10
Source File: JWSFactory.java    From webauthn4j with Apache License 2.0 5 votes vote down vote up
public <T extends Serializable> JWS<T> parse(String value, Class<T> payloadType) {
    String[] data = value.split("\\.");
    if (data.length != 3) {
        throw new IllegalArgumentException("JWS value is not divided by two period.");
    }
    String headerString = data[0];
    String payloadString = data[1];
    String signatureString = data[2];
    JWSHeader header = jsonConverter.readValue(new String(Base64UrlUtil.decode(headerString)), JWSHeader.class);
    T payload = jsonConverter.readValue(new String(Base64UrlUtil.decode(payloadString)), payloadType);
    byte[] signature = Base64UrlUtil.decode(signatureString);
    return new JWS<>(header, headerString, payload, payloadString, signature);
}
 
Example 11
Source File: AttestationObjectConverterTest.java    From webauthn4j with Apache License 2.0 5 votes vote down vote up
@Test
void extractAttestationStatement() {
    String value = "o2NmbXRrYW5kcm9pZC1rZXlnYXR0U3RtdKNjYWxnJmNzaWdYRjBEAiAsp6jPtimcSgc-fgIsVwgqRsZX6eU7KKbkVGWa0CRJlgIgH5yuf_laPyNy4PlS6e8ZHjs57iztxGiTqO7G91sdlWBjeDVjg1kCzjCCAsowggJwoAMCAQICAQEwCgYIKoZIzj0EAwIwgYgxCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApDYWxpZm9ybmlhMRUwEwYDVQQKDAxHb29nbGUsIEluYy4xEDAOBgNVBAsMB0FuZHJvaWQxOzA5BgNVBAMMMkFuZHJvaWQgS2V5c3RvcmUgU29mdHdhcmUgQXR0ZXN0YXRpb24gSW50ZXJtZ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qhkjOPQMBBwNCAATuXV7H4cDbbQOmfua2G-xNal1qaC4P_39JDn13H0Qibb2xr_oWy8etxXfSVpyqt7AtVAFdPkMrKo7XTuxIdUGko2MwYTAdBgNVHQ4EFgQUyK3pd0xFw6PPDRYQ5HlDOiFaMM8wHwYDVR0jBBgwFoAUyK3pd0xFw6PPDRYQ5HlDOiFaMM8wDwYDVR0TAQH_BAUwAwEB_zAOBgNVHQ8BAf8EBAMCAoQwCgYIKoZIzj0EAwIDRwAwRAIgNSGj74s0Rh6c1WDzHViJIGrco2VB9g2ezooZjGZIYHsCIE0L81HZMHx9W9o1NB2oRxtjpYVlPK1PJKfnTa9BffG_aGF1dGhEYXRhWMWVaQiPHs7jIylUA129ENfK45EwWidRtVm7j9fLsim91EUAAAAAKPN9K5K4QcSwKoYM73zANABBAVUvAmX241vMKYd7ZBdmkNWaYcNYhoSZCJjFRGmROb6I4ygQUVmH6k9IMwcbZGeAQ4v4WMNphORudwje5h7ty9ClAQIDJiABIVggOEmiD94mw0sAiDkaWCd4Pf-TiAsWVAiKrfr1eiWVSaEiWCB0PEtSRc8mhc-RBUNnzU-vuUhOcFk2UQEfwNzOdiHGjw";
    byte[] source = Base64UrlUtil.decode(value);
    byte[] bytes = target.extractAttestationStatement(source);
    AndroidKeyAttestationStatement attestationStatement = objectConverter.getCborConverter().readValue(bytes, AndroidKeyAttestationStatement.class);
    assertThat(attestationStatement).isInstanceOf(AndroidKeyAttestationStatement.class);
}
 
Example 12
Source File: CollectedClientDataConverter.java    From webauthn4j with Apache License 2.0 5 votes vote down vote up
/**
 * Converts from a base64url {@link String} to {@link CollectedClientData}.
 *
 * @param base64UrlString the source byte array to convert
 * @return the converted object
 */
public CollectedClientData convert(String base64UrlString) {
    if (base64UrlString == null) {
        return null;
    }
    byte[] bytes = Base64UrlUtil.decode(base64UrlString);
    return convert(bytes);
}
 
Example 13
Source File: PackedAttestationStatementValidatorTest.java    From webauthn4j with Apache License 2.0 5 votes vote down vote up
@Test
void validate_with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HiN4y9OR7RYdv-MVSICm-k4eHlXIzHnJ3AWgopxGznHT9bBJYvR5NnlZtVweQNH2lI1wD8P_kCxQo4FxukXmeR1VHFpAe64i7BXiTWIrYiq0w1xTy8vrDbVTbrXEJxbAnqwyrjPNU7xAIoJCGyghpavDPzbwYOY_N8CMWwmIsle5iK90cAKR4nkocy3SaNUul8nYEIwvv-uBua_AvvAFbzRUd811wqYqOQtykSI_PBxBCGI3-odX3S36niLKvnFFKm6uU_nOJzaGVGQsrEwfb-RGOGpKfg=");
    byte[] clientDataBytes = Base64UrlUtil.decode("ew0KCSJ0eXBlIiA6ICJ3ZWJhdXRobi5jcmVhdGUiLA0KCSJjaGFsbGVuZ2UiIDogIno5LWxDWmFQUlBtMGFReDlLMnE4a3ciLA0KCSJvcmlnaW4iIDogImh0dHA6Ly9sb2NhbGhvc3Q6ODA4MCIsDQoJInRva2VuQmluZGluZyIgOiANCgl7DQoJCSJzdGF0dXMiIDogInN1cHBvcnRlZCINCgl9DQp9");
    AttestationObject attestationObject = new AttestationObjectConverter(objectConverter).convert(attestationObjectBytes);

    validate(clientDataBytes, attestationObject);
}
 
Example 14
Source File: FidoServerAssertionResultEndpointFilter.java    From webauthn4j-spring-security with Apache License 2.0 5 votes vote down vote up
@Override
public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) {
    InputStream inputStream;
    try {
        inputStream = request.getInputStream();
    } catch (IOException e) {
        throw new UncheckedIOException(e);
    }
    ServerPublicKeyCredential<ServerAuthenticatorAssertionResponse> credential =
            jsonConverter.readValue(inputStream, credentialTypeRef);
    serverPublicKeyCredentialValidator.validate(credential);

    ServerAuthenticatorAssertionResponse assertionResponse = credential.getResponse();

    ServerProperty serverProperty = serverPropertyProvider.provide(request);

    CollectedClientData collectedClientData = collectedClientDataConverter.convert(assertionResponse.getClientDataJSON());
    UserVerificationRequirement userVerificationRequirement = serverEndpointFilterUtil.decodeUserVerification(collectedClientData.getChallenge());

    WebAuthnAuthenticationRequest webAuthnAuthenticationRequest = new WebAuthnAuthenticationRequest(
            Base64UrlUtil.decode(credential.getRawId()),
            Base64UrlUtil.decode(assertionResponse.getClientDataJSON()),
            Base64UrlUtil.decode(assertionResponse.getAuthenticatorData()),
            Base64UrlUtil.decode(assertionResponse.getSignature()),
            credential.getClientExtensionResults(),
            serverProperty,
            userVerificationRequirement == UserVerificationRequirement.REQUIRED,
            false,
            expectedAuthenticationExtensionIds
    );

    WebAuthnAssertionAuthenticationToken authRequest = new WebAuthnAssertionAuthenticationToken(webAuthnAuthenticationRequest);
    setDetails(request, authRequest);
    return this.getAuthenticationManager().authenticate(authRequest);
}
 
Example 15
Source File: KeyDescriptionValidatorTest.java    From webauthn4j with Apache License 2.0 4 votes vote down vote up
@Test
void validate_with_teeEnforcedOnly_true_test() {
    X509Certificate certificate = TestAttestationUtil.loadAndroidKeyAttestationCertificate();
    byte[] clientDataHash = Base64UrlUtil.decode("aGVsbG8");
    keyDescriptionValidator.validate(certificate, clientDataHash, true);
}
 
Example 16
Source File: KeyDescriptionValidatorTest.java    From webauthn4j with Apache License 2.0 4 votes vote down vote up
@Test
void validate_test() {
    X509Certificate certificate = TestAttestationUtil.loadAndroidKeyAttestationCertificate();
    byte[] clientDataHash = Base64UrlUtil.decode("aGVsbG8");
    keyDescriptionValidator.validate(certificate, clientDataHash, false);
}
 
Example 17
Source File: AttestationStatementConverter.java    From webauthn4j-spring-security with Apache License 2.0 4 votes vote down vote up
@Override
public AttestationStatement convertToEntityAttribute(String dbData) {
    byte[] data = Base64UrlUtil.decode(dbData);
    AttestationStatementEnvelope container = cborConverter.readValue(data, AttestationStatementEnvelope.class);
    return container.getAttestationStatement();
}
 
Example 18
Source File: COSEKeyConverter.java    From webauthn4j-spring-security with Apache License 2.0 4 votes vote down vote up
@Override
public COSEKey convertToEntityAttribute(String dbData) {
    byte[] data = Base64UrlUtil.decode(dbData);
    return cborConverter.readValue(data, COSEKey.class);
}
 
Example 19
Source File: AttestationStatementConverter.java    From webauthn4j-spring-security with Apache License 2.0 4 votes vote down vote up
@Override
public AttestationStatement convertToEntityAttribute(String dbData) {
    byte[] data = Base64UrlUtil.decode(dbData);
    AttestationStatementSerializationContainer container = cborConverter.readValue(data, AttestationStatementSerializationContainer.class);
    return container.getAttestationStatement();
}
 
Example 20
Source File: AppSpecificMapper.java    From webauthn4j-spring-security with Apache License 2.0 4 votes vote down vote up
public byte[] mapFromBase64Url(String base64url) {
    return Base64UrlUtil.decode(base64url);
}