Skip to content

Bug Report: Duplicate Primary Key Exception in Webauthn4J Authentication #16620

Closed
@Borghii

Description

@Borghii

Describe the Bug

When attempting to authenticate using the following method:

public PublicKeyCredentialUserEntity authenticate(RelyingPartyAuthenticationRequest request)

from Webauthn4JRelyingPartyOperations the process follows these steps:

  1. Retrieve an existing credential record:

CredentialRecord existingCredential = this.userCredentials.findByCredentialId(credentialId);

  1. Save the credential record:

this.userCredentials.save(userCredential);

Image

However, the save method attempts to execute the following SQL insert:

Image

// @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

No one assigned

    Labels

    in: webAn issue in web modules (web, webmvc)status: duplicateA duplicate of another issuetype: bugA general bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions