Class JdbcFederatedIdentityRepository
java.lang.Object
com.codename1.backend.security.oauth2.client.JdbcFederatedIdentityRepository
- All Implemented Interfaces:
FederatedIdentityRepository
public final class JdbcFederatedIdentityRepository
extends Object
implements FederatedIdentityRepository
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.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfindByUsername(String username) The identities tied tousername, each as{provider, subject}.findUsername(String provider, String subject) The local user this identity is tied to, or null.Ties the identity tousername, unless it is tied already.voidThe clock a link's creation time is read from; for tests.booleanUnties the identity.
-
Constructor Details
-
JdbcFederatedIdentityRepository
-
-
Method Details
-
setClock
The clock a link's creation time is read from; for tests. -
findUsername
Description copied from interface:FederatedIdentityRepositoryThe local user this identity is tied to, or null.- Specified by:
findUsernamein interfaceFederatedIdentityRepository
-
link
Description copied from interface:FederatedIdentityRepositoryTies the identity tousername, unless it is tied already.- Specified by:
linkin interfaceFederatedIdentityRepository- Returns:
- the user the identity is tied to once this returns:
username, or the one another request tied it to first
-
unlink
Description copied from interface:FederatedIdentityRepositoryUnties the identity.- Specified by:
unlinkin interfaceFederatedIdentityRepository- Returns:
- whether it was tied
-
findByUsername
Description copied from interface:FederatedIdentityRepositoryThe identities tied tousername, each as{provider, subject}.- Specified by:
findByUsernamein interfaceFederatedIdentityRepository
-