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 theAuthenticatorused 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 theUserassociated with the credential.booleanIndicates whether this credential was registered as a resident credential/client-side discoverable credentialbooleanIndicates 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- theidof the credentialuser- theuserassociated with the credentialcreatedAt- thetime of creationof the credentiallastUsed- thelast usage timefor authenticationisResidentKey- whether this credential is a resident key credentialuserVerification- whether this credential was registered with user verificationname- thenameof the credentialauthenticator- theauthenticatorused for registration
-
-
Method Details
-
getId
Get the credential ID- Returns:
- the ID of the credential as a String
-
getUser
Get theUserassociated 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 theAuthenticatorused for registering the credential.- Returns:
- the
Authenticator
-