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

public final class JdbcFederatedIdentityRepository

  1. Object
  2. JdbcFederatedIdentityRepository

ImplementsFederatedIdentityRepository

Identities kept in the server’s database, in the cn1_federated_identity table of SecuritySchema.

@Bean
FederatedIdentityRepository identities(DataSource dataSource) {
    return new JdbcFederatedIdentityRepository(dataSource);
}

The pair of provider and subject is the table’s key, so of two processes that tie the same identity at the same moment one inserts the row and the other reads it: both answer the same user.

Constructors

public JdbcFederatedIdentityRepository(DataSource dataSource)

Methods

public void setClock(Clock clock)The clock a link’s creation time is read from; for tests.
public String findUsername(String provider, String subject)The local user this identity is tied to, or null.
public String link(String provider, String subject, String username)Ties the identity to username, unless it is tied already.
public boolean unlink(String provider, String subject)Unties the identity.
public List<String[]> findByUsername(String username)The identities tied to username, each as {provider, subject}.

Inherited methods

Constructor details

JdbcFederatedIdentityRepository

public JdbcFederatedIdentityRepository(DataSource dataSource)

Method details

setClock

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

findUsername

public String findUsername(String provider, String subject)
The local user this identity is tied to, or null.

link

public String link(String provider, String subject, String username)
Ties the identity to username, unless it is tied already.

Returns

the user the identity is tied to once this returns: username, or the one another request tied it to first

unlink

public boolean unlink(String provider, String subject)
Unties the identity.

Returns

whether it was tied

findByUsername

public List<String[]> findByUsername(String username)
The identities tied to username, each as {provider, subject}.