public class JdbcOAuth2AuthorizationService extends java.lang.Object implements OAuth2AuthorizationService
OAuth2AuthorizationService that uses a
JdbcOperations for OAuth2Authorization persistence.
NOTE: This OAuth2AuthorizationService depends on the table definition
described in
"classpath:org/springframework/security/oauth2/server/authorization/oauth2-authorization-schema.sql" and
therefore MUST be defined in the database schema.
OAuth2AuthorizationService,
OAuth2Authorization,
JdbcOperations,
RowMapper| Modifier and Type | Class and Description |
|---|---|
static class |
JdbcOAuth2AuthorizationService.OAuth2AuthorizationParametersMapper
|
static class |
JdbcOAuth2AuthorizationService.OAuth2AuthorizationRowMapper
|
| Constructor and Description |
|---|
JdbcOAuth2AuthorizationService(org.springframework.jdbc.core.JdbcOperations jdbcOperations,
RegisteredClientRepository registeredClientRepository)
Constructs a
JdbcOAuth2AuthorizationService using the provided parameters. |
JdbcOAuth2AuthorizationService(org.springframework.jdbc.core.JdbcOperations jdbcOperations,
RegisteredClientRepository registeredClientRepository,
org.springframework.jdbc.support.lob.LobHandler lobHandler)
Constructs a
JdbcOAuth2AuthorizationService using the provided parameters. |
| Modifier and Type | Method and Description |
|---|---|
OAuth2Authorization |
findById(java.lang.String id)
|
OAuth2Authorization |
findByToken(java.lang.String token,
OAuth2TokenType tokenType)
|
protected java.util.function.Function<OAuth2Authorization,java.util.List<org.springframework.jdbc.core.SqlParameterValue>> |
getAuthorizationParametersMapper() |
protected org.springframework.jdbc.core.RowMapper<OAuth2Authorization> |
getAuthorizationRowMapper() |
protected org.springframework.jdbc.core.JdbcOperations |
getJdbcOperations() |
protected org.springframework.jdbc.support.lob.LobHandler |
getLobHandler() |
void |
remove(OAuth2Authorization authorization)
Removes the
OAuth2Authorization. |
void |
save(OAuth2Authorization authorization)
Saves the
OAuth2Authorization. |
void |
setAuthorizationParametersMapper(java.util.function.Function<OAuth2Authorization,java.util.List<org.springframework.jdbc.core.SqlParameterValue>> authorizationParametersMapper)
|
void |
setAuthorizationRowMapper(org.springframework.jdbc.core.RowMapper<OAuth2Authorization> authorizationRowMapper)
|
public JdbcOAuth2AuthorizationService(org.springframework.jdbc.core.JdbcOperations jdbcOperations,
RegisteredClientRepository registeredClientRepository)
JdbcOAuth2AuthorizationService using the provided parameters.jdbcOperations - the JDBC operationsregisteredClientRepository - the registered client repositorypublic JdbcOAuth2AuthorizationService(org.springframework.jdbc.core.JdbcOperations jdbcOperations,
RegisteredClientRepository registeredClientRepository,
org.springframework.jdbc.support.lob.LobHandler lobHandler)
JdbcOAuth2AuthorizationService using the provided parameters.jdbcOperations - the JDBC operationsregisteredClientRepository - the registered client repositorylobHandler - the handler for large binary fields and large text fieldspublic void save(OAuth2Authorization authorization)
OAuth2AuthorizationServiceOAuth2Authorization.save in interface OAuth2AuthorizationServiceauthorization - the OAuth2Authorizationpublic void remove(OAuth2Authorization authorization)
OAuth2AuthorizationServiceOAuth2Authorization.remove in interface OAuth2AuthorizationServiceauthorization - the OAuth2Authorization@Nullable public OAuth2Authorization findById(java.lang.String id)
OAuth2AuthorizationServicefindById in interface OAuth2AuthorizationServiceid - the authorization identifierOAuth2Authorization if found, otherwise null@Nullable public OAuth2Authorization findByToken(java.lang.String token, @Nullable OAuth2TokenType tokenType)
OAuth2AuthorizationServicefindByToken in interface OAuth2AuthorizationServicetoken - the token credentialtokenType - the token typeOAuth2Authorization if found, otherwise nullpublic final void setAuthorizationRowMapper(org.springframework.jdbc.core.RowMapper<OAuth2Authorization> authorizationRowMapper)
RowMapper used for mapping the current row in
java.sql.ResultSet to OAuth2Authorization. The default is
JdbcOAuth2AuthorizationService.OAuth2AuthorizationRowMapper.authorizationRowMapper - the RowMapper used for mapping the current
row in ResultSet to OAuth2Authorizationpublic final void setAuthorizationParametersMapper(java.util.function.Function<OAuth2Authorization,java.util.List<org.springframework.jdbc.core.SqlParameterValue>> authorizationParametersMapper)
Function used for mapping OAuth2Authorization to
a List of SqlParameterValue. The default is
JdbcOAuth2AuthorizationService.OAuth2AuthorizationParametersMapper.authorizationParametersMapper - the Function used for mapping
OAuth2Authorization to a List of SqlParameterValueprotected final org.springframework.jdbc.core.JdbcOperations getJdbcOperations()
protected final org.springframework.jdbc.support.lob.LobHandler getLobHandler()
protected final org.springframework.jdbc.core.RowMapper<OAuth2Authorization> getAuthorizationRowMapper()
protected final java.util.function.Function<OAuth2Authorization,java.util.List<org.springframework.jdbc.core.SqlParameterValue>> getAuthorizationParametersMapper()