Class RegistrationService
java.lang.Object
org.ntnu.idi.idatt2106.sparesti.sparestibackend.service.RegistrationService
- All Implemented Interfaces:
com.yubico.webauthn.CredentialRepository
@Repository
public class RegistrationService
extends Object
implements com.yubico.webauthn.CredentialRepository
Service class for handling business logic related to biometric registration and login
- Since:
- 28.4.24
- Version:
- 1.0
- Author:
- Yasin M.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSet
<com.yubico.webauthn.data.PublicKeyCredentialDescriptor> getCredentialIdsForUsername
(String username) Gets all associated credential id's for a user, using their usernameOptional
<com.yubico.webauthn.data.ByteArray> getUserHandleForUsername
(String username) Gets the handle of a user, based on the user's usernamegetUsernameForUserHandle
(com.yubico.webauthn.data.ByteArray userHandle) Gets the username of a User based on their handleOptional
<com.yubico.webauthn.RegisteredCredential> lookup
(com.yubico.webauthn.data.ByteArray credentialId, com.yubico.webauthn.data.ByteArray userHandle) Looks up biometric registration credentials using the credential IDSet
<com.yubico.webauthn.RegisteredCredential> lookupAll
(com.yubico.webauthn.data.ByteArray credentialId) Gets a set of Registered credentials using credential Id
-
Constructor Details
-
RegistrationService
public RegistrationService()
-
-
Method Details
-
getCredentialIdsForUsername
public Set<com.yubico.webauthn.data.PublicKeyCredentialDescriptor> getCredentialIdsForUsername(String username) Gets all associated credential id's for a user, using their username- Specified by:
getCredentialIdsForUsername
in interfacecom.yubico.webauthn.CredentialRepository
- Parameters:
username
- Username of user- Returns:
- Set of Credential Id's
-
getUserHandleForUsername
Gets the handle of a user, based on the user's username- Specified by:
getUserHandleForUsername
in interfacecom.yubico.webauthn.CredentialRepository
- Parameters:
username
- Username of user- Returns:
- Handle of the User entity, if they have one
-
getUsernameForUserHandle
Gets the username of a User based on their handle- Specified by:
getUsernameForUserHandle
in interfacecom.yubico.webauthn.CredentialRepository
- Parameters:
userHandle
- A users unique handle, used for biometric purposes- Returns:
- Username of the user, if they exist
-
lookup
public Optional<com.yubico.webauthn.RegisteredCredential> lookup(com.yubico.webauthn.data.ByteArray credentialId, com.yubico.webauthn.data.ByteArray userHandle) Looks up biometric registration credentials using the credential ID- Specified by:
lookup
in interfacecom.yubico.webauthn.CredentialRepository
- Parameters:
credentialId
- Identifies biometric entryuserHandle
- User handle- Returns:
- RegisteredCredentials of a user, if it exists
-
lookupAll
public Set<com.yubico.webauthn.RegisteredCredential> lookupAll(com.yubico.webauthn.data.ByteArray credentialId) Gets a set of Registered credentials using credential Id- Specified by:
lookupAll
in interfacecom.yubico.webauthn.CredentialRepository
- Parameters:
credentialId
- Identifies biometric registration entries- Returns:
- Set of registered credentials of a user
-