- 
                Notifications
    You must be signed in to change notification settings 
- Fork 6.2k
Closed
Closed
Copy link
Labels
in: webAn issue in web modules (web, webmvc)An issue in web modules (web, webmvc)status: duplicateA duplicate of another issueA duplicate of another issuetype: bugA general bugA general bug
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
Labels
in: webAn issue in web modules (web, webmvc)An issue in web modules (web, webmvc)status: duplicateA duplicate of another issueA duplicate of another issuetype: bugA general bugA general bug

