Closed
Description
Describe the Bug
When attempting to authenticate using the following method:
public PublicKeyCredentialUserEntity authenticate(RelyingPartyAuthenticationRequest request)
from Webauthn4JRelyingPartyOperations the process follows these steps:
- Retrieve an existing credential record:
CredentialRecord existingCredential = this.userCredentials.findByCredentialId(credentialId);
- Save the credential record:
this.userCredentials.save(userCredential);
However, the save method attempts to execute the following SQL insert:
// @formatter:off
private static final String SAVE_CREDENTIAL_RECORD_SQL = "INSERT INTO " + TABLE_NAME
+ " (" + COLUMN_NAMES + ") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
This results in a duplicate primary key exception, as the credential record already exists in the database.
I don't know if I'm missing something.
Metadata
Metadata
Assignees
Type
Projects
Milestone
Relationships
Development
- Fix JdbcUserCredentialRepository Savespring-projects/spring-security
- Fix JdbcUserCredentialRepository Savespring-projects/spring-security
- Fix JdbcUserCredentialRepository SaveGuusArts/spring-security
- Fix JdbcUserCredentialRepository SaveGuusArts/spring-security
- Fix JdbcUserCredentialRepository Save Final 16621GuusArts/spring-security
- Fix JdbcUserCredentialRepository Save initial commit 16621GuusArts/spring-security
Activity
Borghii commentedon Feb 19, 2025
@franticticktick can you revise it?
Fix JdbcUserCredentialRepository Save
franticticktick commentedon Feb 19, 2025
Hi @Borghii , thanks for this catch :) it will be fixed via #16621
jzheaux commentedon Feb 24, 2025
Thanks for reporting this, @Borghii. I'll close this in favor of @franticticktick's PR.
Fix JdbcUserCredentialRepository Save
Fix JdbcUserCredentialRepository Save
Fix JdbcUserCredentialRepository Save
Fix JdbcUserCredentialRepository Save
5 remaining items