Class JpaUserCredentialRepositoryAdapter
java.lang.Object
sk.iway.iwcm.system.spring.passkey.JpaUserCredentialRepositoryAdapter
- All Implemented Interfaces:
org.springframework.security.web.webauthn.management.UserCredentialRepository
@Component
public class JpaUserCredentialRepositoryAdapter
extends Object
implements org.springframework.security.web.webauthn.management.UserCredentialRepository
JPA-backed adapter implementing Spring Security's UserCredentialRepository.
Bridges between Spring Security's WebAuthn API (which works with CredentialRecord
interface and Bytes IDs) and our JPA PasskeyCredentialBean entities.
This replaces the previous JdbcUserCredentialRepository that had persistence
issues with the project's DataSource/connection pool.
-
Constructor Summary
ConstructorsConstructorDescriptionJpaUserCredentialRepositoryAdapter(PasskeyCredentialRepository credentialRepository, UserDetailsRepository userDetailsRepository) -
Method Summary
Modifier and TypeMethodDescriptionvoiddelete(org.springframework.security.web.webauthn.api.Bytes credentialId) org.springframework.security.web.webauthn.api.CredentialRecordfindByCredentialId(org.springframework.security.web.webauthn.api.Bytes credentialId) List<org.springframework.security.web.webauthn.api.CredentialRecord>findByUserId(org.springframework.security.web.webauthn.api.Bytes userId) voidsave(org.springframework.security.web.webauthn.api.CredentialRecord record)
-
Constructor Details
-
JpaUserCredentialRepositoryAdapter
public JpaUserCredentialRepositoryAdapter(PasskeyCredentialRepository credentialRepository, UserDetailsRepository userDetailsRepository)
-
-
Method Details
-
save
@Transactional public void save(org.springframework.security.web.webauthn.api.CredentialRecord record) - Specified by:
savein interfaceorg.springframework.security.web.webauthn.management.UserCredentialRepository
-
findByCredentialId
@Transactional(readOnly=true) public org.springframework.security.web.webauthn.api.CredentialRecord findByCredentialId(org.springframework.security.web.webauthn.api.Bytes credentialId) - Specified by:
findByCredentialIdin interfaceorg.springframework.security.web.webauthn.management.UserCredentialRepository
-
findByUserId
@Transactional(readOnly=true) public List<org.springframework.security.web.webauthn.api.CredentialRecord> findByUserId(org.springframework.security.web.webauthn.api.Bytes userId) - Specified by:
findByUserIdin interfaceorg.springframework.security.web.webauthn.management.UserCredentialRepository
-
delete
@Transactional public void delete(org.springframework.security.web.webauthn.api.Bytes credentialId) - Specified by:
deletein interfaceorg.springframework.security.web.webauthn.management.UserCredentialRepository
-