Backend API. Server-side code: this runs in a Codename One backend, not in the app on the device.

public final class JdbcPublicKeyCredentialUserEntityRepository

  1. Object
  2. JdbcPublicKeyCredentialUserEntityRepository

ImplementsPublicKeyCredentialUserEntityRepository

User handles kept in the server’s database, in the cn1_webauthn_user table of SecuritySchema.

The table is keyed by the user’s name and the handle is unique in it, so a user has one handle and a handle one user, whatever arrives at once: the first to store a name wins, and save answers what the first stored.

Constructors

public JdbcPublicKeyCredentialUserEntityRepository(DataSource dataSource)

Methods

public void setClock(Clock clock)The clock a row’s creation time is read from; for tests.
public PublicKeyCredentialUserEntity findById(byte[] id)The user with this handle, or null.
public PublicKeyCredentialUserEntity findByUsername(String username)The user of this name, or null.
public PublicKeyCredentialUserEntity save(PublicKeyCredentialUserEntity user)Stores user, unless a user of that name is there already.
public void delete(byte[] id)Forgets the user with this handle.

Inherited methods

Constructor details

JdbcPublicKeyCredentialUserEntityRepository

public JdbcPublicKeyCredentialUserEntityRepository(DataSource dataSource)

Method details

setClock

public void setClock(Clock clock)
The clock a row’s creation time is read from; for tests.

findById

public PublicKeyCredentialUserEntity findById(byte[] id)
The user with this handle, or null.

findByUsername

public PublicKeyCredentialUserEntity findByUsername(String username)
The user of this name, or null. Names differing only in the case of A to Z are the same user.

save

public PublicKeyCredentialUserEntity save(PublicKeyCredentialUserEntity user)
Stores user, unless a user of that name is there already.

Returns

the user of that name as stored: user, or the one that was there first – whose handle is then the one to use

delete

public void delete(byte[] id)
Forgets the user with this handle. Their credentials are another repository’s to remove.