Java Code Examples for com.webauthn4j.converter.util.ObjectConverter#getJsonConverter()

The following examples show how to use com.webauthn4j.converter.util.ObjectConverter#getJsonConverter() . 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: FidoServerAssertionResultEndpointFilter.java    From webauthn4j-spring-security with Apache License 2.0 6 votes vote down vote up
public FidoServerAssertionResultEndpointFilter(
        ObjectConverter objectConverter,
        ServerPropertyProvider serverPropertyProvider,
        RequestMatcher requiresAuthenticationRequestMatcher) {
    super(requiresAuthenticationRequestMatcher);

    this.jsonConverter = objectConverter.getJsonConverter();
    this.serverPropertyProvider = serverPropertyProvider;
    this.serverPublicKeyCredentialValidator = new ServerPublicKeyCredentialValidator<>();

    this.setAuthenticationSuccessHandler(new FidoServerAssertionResultEndpointSuccessHandler(objectConverter));
    this.setAuthenticationFailureHandler(new FidoServerAssertionResultEndpointFailureHandler(objectConverter));

    this.collectedClientDataConverter = new CollectedClientDataConverter(objectConverter);
    this.serverEndpointFilterUtil = new ServerEndpointFilterUtil(objectConverter);

    checkConfig();
}
 
Example 2
Source File: ExtensionClientOutputDeserializerTest.java    From webauthn4j with Apache License 2.0 5 votes vote down vote up
@Test
void deserialize_test_with_JSON_data() {
    ObjectConverter objectConverter = new ObjectConverter();
    JsonConverter jsonConverter = objectConverter.getJsonConverter();

    Map<String, ExtensionClientOutput<?>> extensionOutputs =
            jsonConverter.readValue(
                    "{ " +
                            "\"appid\": true, " +
                            "\"credProps\": {\"rk\": true }, " +
                            "\"txAuthSimple\": \"authorization message\", " +
                            "\"txAuthGeneric\": { \"contentType\": \"image/png\", \"content\": null }, " +
                            "\"authnSel\": true, " +
                            "\"exts\": [\"exts\", \"authnSel\"], " +
                            "\"uvi\": [], " +
                            "\"loc\": { \"latitude\": 0, \"longitude\":0, \"accuracy\": 1 }, " +
                            "\"biometricPerfBounds\": true " +
                            "}",
                    new TypeReference<Map<String, ExtensionClientOutput<?>>>() {
                    }
            );

    assertAll(
            () -> assertThat(extensionOutputs).containsKeys(
                    FIDOAppIDExtensionClientOutput.ID,
                    CredentialPropertiesExtensionClientOutput.ID
            ),
            () -> assertThat(extensionOutputs).containsValues(
                    new FIDOAppIDExtensionClientOutput(true),
                    new CredentialPropertiesExtensionClientOutput(new CredentialPropertiesExtensionClientOutput.CredentialPropertiesOutput(true))
            )
    );
}
 
Example 3
Source File: FidoMdsMetadataItemsProvider.java    From webauthn4j with Apache License 2.0 5 votes vote down vote up
public FidoMdsMetadataItemsProvider(ObjectConverter objectConverter, String token, HttpClient httpClient, X509Certificate rootCertificate) {
    this.jsonConverter = objectConverter.getJsonConverter();
    this.jwsFactory = new JWSFactory(objectConverter);
    this.token = token;
    this.httpClient = httpClient;
    this.trustAnchor = new TrustAnchor(rootCertificate, null);
}
 
Example 4
Source File: JsonFileResourceMetadataStatementsProvider.java    From webauthn4j-spring-security with Apache License 2.0 4 votes vote down vote up
public JsonFileResourceMetadataStatementsProvider(ObjectConverter objectConverter) {
    Assert.notNull(objectConverter, "objectConverter must not be null");
    this.jsonConverter = objectConverter.getJsonConverter();
}
 
Example 5
Source File: OptionsEndpointFilter.java    From webauthn4j-spring-security with Apache License 2.0 4 votes vote down vote up
public OptionsEndpointFilter(OptionsProvider optionsProvider, ObjectConverter objectConverter) {
    this.optionsProvider = optionsProvider;
    this.jsonConverter = objectConverter.getJsonConverter();
    this.trustResolver = new AuthenticationTrustResolverImpl();
    checkConfig();
}
 
Example 6
Source File: ServerEndpointFilterUtil.java    From webauthn4j-spring-security with Apache License 2.0 4 votes vote down vote up
ServerEndpointFilterUtil(ObjectConverter objectConverter) {
    this.jsonConverter = objectConverter.getJsonConverter();
    this.cborConverter = objectConverter.getCborConverter();
}
 
Example 7
Source File: ClientExtensionsConverter.java    From webauthn4j-spring-security with Apache License 2.0 4 votes vote down vote up
public ClientExtensionsConverter(ObjectConverter objectConverter) {
    this.jsonConverter = objectConverter.getJsonConverter();
}
 
Example 8
Source File: ClientExtensionsConverter.java    From webauthn4j-spring-security with Apache License 2.0 4 votes vote down vote up
public ClientExtensionsConverter(ObjectConverter objectConverter) {
    this.jsonConverter = objectConverter.getJsonConverter();
}
 
Example 9
Source File: CollectedClientDataConverter.java    From webauthn4j with Apache License 2.0 4 votes vote down vote up
public CollectedClientDataConverter(ObjectConverter objectConverter) {
    AssertUtil.notNull(objectConverter, "objectConverter must not be null");
    this.jsonConverter = objectConverter.getJsonConverter();
}
 
Example 10
Source File: AuthenticationExtensionsClientInputsConverter.java    From webauthn4j with Apache License 2.0 4 votes vote down vote up
public AuthenticationExtensionsClientInputsConverter(ObjectConverter objectConverter) {
    AssertUtil.notNull(objectConverter, "objectConverter must not be null");
    this.jsonConverter = objectConverter.getJsonConverter();
}
 
Example 11
Source File: AuthenticationExtensionsClientOutputsConverter.java    From webauthn4j with Apache License 2.0 4 votes vote down vote up
public AuthenticationExtensionsClientOutputsConverter(ObjectConverter objectConverter) {
    AssertUtil.notNull(objectConverter, "objectConverter must not be null");
    this.jsonConverter = objectConverter.getJsonConverter();
}
 
Example 12
Source File: JWSFactory.java    From webauthn4j with Apache License 2.0 4 votes vote down vote up
public JWSFactory(ObjectConverter objectConverter) {
    this.jsonConverter = objectConverter.getJsonConverter();
}
 
Example 13
Source File: JsonFileMetadataStatementsProvider.java    From webauthn4j with Apache License 2.0 4 votes vote down vote up
public JsonFileMetadataStatementsProvider(ObjectConverter objectConverter, List<Path> paths) {
    this.jsonConverter = objectConverter.getJsonConverter();
    this.paths = paths;
}