java.lang.Object
com.webauthn4j.WebAuthnAuthenticationManager
Manager class for WebAuthn authentication operations.
This class provides methods for parsing and verifying WebAuthn authentication data.
It handles the authentication phase of the WebAuthn authentication process, including
signature verification and custom authentication verification.
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor for WebAuthnAuthenticationManager Creates an instance with empty custom authentication verifiers and default object converterWebAuthnAuthenticationManager(@NotNull List<CustomAuthenticationVerifier> customAuthenticationVerifiers) Constructor for WebAuthnAuthenticationManager with custom verifiersWebAuthnAuthenticationManager(@NotNull List<CustomAuthenticationVerifier> customAuthenticationVerifiers, @NotNull ObjectConverter objectConverter) Constructor for WebAuthnAuthenticationManager with custom verifiers and object converter -
Method Summary
Modifier and TypeMethodDescription@NotNull AuthenticationDataVerifierGets the authentication data verifier@NotNull AuthenticationDataparse(@NotNull AuthenticationRequest authenticationRequest) Parses a WebAuthn authentication request@NotNull AuthenticationDataparse(@NotNull InputStream authenticationResponseJSON) Parses a WebAuthn authentication response JSON from an input stream@NotNull AuthenticationDataParses a WebAuthn authentication response JSON string@NotNull AuthenticationDataverify(@NotNull AuthenticationData authenticationData, @NotNull AuthenticationParameters authenticationParameters) Verifies WebAuthn authentication data@NotNull AuthenticationDataverify(@NotNull AuthenticationRequest authenticationRequest, @NotNull AuthenticationParameters authenticationParameters) Verifies a WebAuthn authentication request@NotNull AuthenticationDataverify(@NotNull InputStream authenticationResponseJSON, @NotNull AuthenticationParameters authenticationParameters) Verifies a WebAuthn authentication response JSON from an input stream@NotNull AuthenticationDataverify(@NotNull String authenticationResponseJSON, @NotNull AuthenticationParameters authenticationParameters) Verifies a WebAuthn authentication response JSON string
-
Constructor Details
-
WebAuthnAuthenticationManager
public WebAuthnAuthenticationManager(@NotNull @NotNull List<CustomAuthenticationVerifier> customAuthenticationVerifiers, @NotNull @NotNull ObjectConverter objectConverter) Constructor for WebAuthnAuthenticationManager with custom verifiers and object converter- Parameters:
customAuthenticationVerifiers- list of custom authentication verifiersobjectConverter- converter for object serialization/deserialization
-
WebAuthnAuthenticationManager
public WebAuthnAuthenticationManager(@NotNull @NotNull List<CustomAuthenticationVerifier> customAuthenticationVerifiers) Constructor for WebAuthnAuthenticationManager with custom verifiers- Parameters:
customAuthenticationVerifiers- list of custom authentication verifiers
-
WebAuthnAuthenticationManager
public WebAuthnAuthenticationManager()Default constructor for WebAuthnAuthenticationManager Creates an instance with empty custom authentication verifiers and default object converter
-
-
Method Details
-
parse
@NotNull public @NotNull AuthenticationData parse(@NotNull @NotNull String authenticationResponseJSON) Parses a WebAuthn authentication response JSON string- Parameters:
authenticationResponseJSON- the authentication response in JSON format- Returns:
- the parsed authentication data
-
parse
@NotNull public @NotNull AuthenticationData parse(@NotNull @NotNull InputStream authenticationResponseJSON) Parses a WebAuthn authentication response JSON from an input stream- Parameters:
authenticationResponseJSON- the authentication response in JSON format as an input stream- Returns:
- the parsed authentication data
-
parse
@NotNull public @NotNull AuthenticationData parse(@NotNull @NotNull AuthenticationRequest authenticationRequest) throws DataConversionException Parses a WebAuthn authentication request- Parameters:
authenticationRequest- the authentication request to parse- Returns:
- the parsed authentication data
- Throws:
DataConversionException- if data conversion fails
-
verify
@NotNull public @NotNull AuthenticationData verify(@NotNull @NotNull String authenticationResponseJSON, @NotNull @NotNull AuthenticationParameters authenticationParameters) throws DataConversionException, VerificationException Verifies a WebAuthn authentication response JSON string- Parameters:
authenticationResponseJSON- the authentication response in JSON formatauthenticationParameters- the parameters for authentication verification- Returns:
- the verified authentication data
- Throws:
DataConversionException- if data conversion failsVerificationException- if verification fails
-
verify
@NotNull public @NotNull AuthenticationData verify(@NotNull @NotNull InputStream authenticationResponseJSON, @NotNull @NotNull AuthenticationParameters authenticationParameters) throws DataConversionException, VerificationException Verifies a WebAuthn authentication response JSON from an input stream- Parameters:
authenticationResponseJSON- the authentication response in JSON format as an input streamauthenticationParameters- the parameters for authentication verification- Returns:
- the verified authentication data
- Throws:
DataConversionException- if data conversion failsVerificationException- if verification fails
-
verify
@NotNull public @NotNull AuthenticationData verify(@NotNull @NotNull AuthenticationRequest authenticationRequest, @NotNull @NotNull AuthenticationParameters authenticationParameters) throws DataConversionException, VerificationException Verifies a WebAuthn authentication request- Parameters:
authenticationRequest- the authentication request to verifyauthenticationParameters- the parameters for authentication verification- Returns:
- the verified authentication data
- Throws:
DataConversionException- if data conversion failsVerificationException- if verification fails
-
verify
@NotNull public @NotNull AuthenticationData verify(@NotNull @NotNull AuthenticationData authenticationData, @NotNull @NotNull AuthenticationParameters authenticationParameters) throws VerificationException Verifies WebAuthn authentication data- Parameters:
authenticationData- the authentication data to verifyauthenticationParameters- the parameters for authentication verification- Returns:
- the verified authentication data
- Throws:
VerificationException- if verification fails
-
getAuthenticationDataVerifier
Gets the authentication data verifier- Returns:
- the authentication data verifier
-