Package io.hanko.sdk.webauthn.api
Class WebAuthnCredential
java.lang.Object
io.hanko.sdk.webauthn.api.WebAuthnCredential
Representation of a credential.
-
Constructor Summary
ConstructorsConstructorDescriptionWebAuthnCredential(String id, User user, String createdAt, String lastUsed, boolean isResidentKey, String name, boolean userVerification, Authenticator authenticator)
Construct a WebAuthnCredential. -
Method Summary
Modifier and TypeMethodDescriptionGet theAuthenticator
used for registering the credential.Get the time of credential creation.getId()
Get the credential IDGet the last time this credential was used for authenticationgetName()
Get the name for the credential.getUser()
Get theUser
associated with the credential.boolean
Indicates whether this credential was registered as a resident credential/client-side discoverable credentialboolean
Indicates whether this credential was registered with a successful user verification process.
-
Constructor Details
-
WebAuthnCredential
public WebAuthnCredential(String id, User user, String createdAt, String lastUsed, boolean isResidentKey, String name, boolean userVerification, Authenticator authenticator)Construct a WebAuthnCredential.Generally, there is no need for SDK clients to ever manually instantiate WebAuthnCredentials since they are part of Hanko API responses that are deserialized through the SDK.
- Parameters:
id
- theid
of the credentialuser
- theuser
associated with the credentialcreatedAt
- thetime of creation
of the credentiallastUsed
- thelast usage time
for authenticationisResidentKey
- whether this credential is a resident key credentialuserVerification
- whether this credential was registered with user verificationname
- thename
of the credentialauthenticator
- theauthenticator
used for registration
-
-
Method Details
-
getId
Get the credential ID- Returns:
- the ID of the credential as a String
-
getUser
Get theUser
associated with the credential.- Returns:
- the user who registered the credential
-
getCreatedAt
Get the time of credential creation.- Returns:
- the time of credential creation in date-time notation as defined by RFC 3339, section 5.6
-
getLastUsed
Get the last time this credential was used for authentication- Returns:
- the last usage in date-time notation as defined by RFC 3339, section 5.6
-
isResidentKey
public boolean isResidentKey()Indicates whether this credential was registered as a resident credential/client-side discoverable credential- Returns:
- true if it was registered as a resident credential, false otherwise
-
getName
Get the name for the credential. The name has a default value on credential creation but can be changed later through theupdate credential operation
.- Returns:
- the name as a String
-
isUserVerification
public boolean isUserVerification()Indicates whether this credential was registered with a successful user verification process.- Returns:
- true if the credential was registered with user verification, false otherwise
-
getAuthenticator
Get theAuthenticator
used for registering the credential.- Returns:
- the
Authenticator
-