Package org.springframework.security.web.webauthn.management

# Interface UserCredentialRepository

All Known Implementing Classes:
  `MapUserCredentialRepository`

public interface UserCredentialRepository
A repository for managing `CredentialRecord`s associated to a user.

Since:
  6.4

## Method Summary

Modifier and Type
Method
Description
`void`
`delete(Bytes credentialId)`
Deletes an entry by credential id
`CredentialRecord`
`findByCredentialId(Bytes credentialId)`
Finds an entry by credential id.
`List<CredentialRecord>`
`findByUserId(Bytes userId)`
Finds all `CredentialRecord` instances for a specific user.
`void`
`save(CredentialRecord credentialRecord)`
Saves a `CredentialRecord`

## Method Details

### delete

void delete(Bytes credentialId)
Deletes an entry by credential id

Parameters:
  `credentialId` - `CredentialRecord.getCredentialId()`

### save

void save(CredentialRecord credentialRecord)
Saves a `CredentialRecord`

Parameters:
  `credentialRecord` - the `CredentialRecord` to save.

### findByCredentialId

CredentialRecord findByCredentialId(Bytes credentialId)
Finds an entry by credential id.

Parameters:
  `credentialId` - `CredentialRecord.getCredentialId()`
Returns:
  the `CredentialRecord` or null if not found.

### findByUserId

List<CredentialRecord> findByUserId(Bytes userId)
Finds all `CredentialRecord` instances for a specific user.

Parameters:
  `userId` - the `PublicKeyCredentialUserEntity.getId()` to search for a user.
Returns:
  all `CredentialRecord` instances for a specific user or empty if no results found. Never null.
See Also:
  - `PublicKeyCredentialUserEntityRepository`