public class JdbcOAuth2AuthorizationConsentService extends java.lang.Object implements OAuth2AuthorizationConsentService
OAuth2AuthorizationConsentService that uses a
JdbcOperations for OAuth2AuthorizationConsent persistence.
NOTE: This OAuth2AuthorizationConsentService depends on the table definition
described in
"classpath:org/springframework/security/oauth2/server/authorization/oauth2-authorization-consent-schema.sql" and
therefore MUST be defined in the database schema.
OAuth2AuthorizationConsentService,
OAuth2AuthorizationConsent,
JdbcOperations,
RowMapper| Modifier and Type | Class and Description |
|---|---|
static class |
JdbcOAuth2AuthorizationConsentService.OAuth2AuthorizationConsentParametersMapper
|
static class |
JdbcOAuth2AuthorizationConsentService.OAuth2AuthorizationConsentRowMapper
|
| Constructor and Description |
|---|
JdbcOAuth2AuthorizationConsentService(org.springframework.jdbc.core.JdbcOperations jdbcOperations,
RegisteredClientRepository registeredClientRepository)
Constructs a
JdbcOAuth2AuthorizationConsentService using the provided parameters. |
| Modifier and Type | Method and Description |
|---|---|
OAuth2AuthorizationConsent |
findById(java.lang.String registeredClientId,
java.lang.String principalName)
Returns the
OAuth2AuthorizationConsent identified by the provided
registeredClientId and principalName, or null if not found. |
protected java.util.function.Function<OAuth2AuthorizationConsent,java.util.List<org.springframework.jdbc.core.SqlParameterValue>> |
getAuthorizationConsentParametersMapper() |
protected org.springframework.jdbc.core.RowMapper<OAuth2AuthorizationConsent> |
getAuthorizationConsentRowMapper() |
protected org.springframework.jdbc.core.JdbcOperations |
getJdbcOperations() |
void |
remove(OAuth2AuthorizationConsent authorizationConsent)
Removes the
OAuth2AuthorizationConsent. |
void |
save(OAuth2AuthorizationConsent authorizationConsent)
Saves the
OAuth2AuthorizationConsent. |
void |
setAuthorizationConsentParametersMapper(java.util.function.Function<OAuth2AuthorizationConsent,java.util.List<org.springframework.jdbc.core.SqlParameterValue>> authorizationConsentParametersMapper)
|
void |
setAuthorizationConsentRowMapper(org.springframework.jdbc.core.RowMapper<OAuth2AuthorizationConsent> authorizationConsentRowMapper)
Sets the
RowMapper used for mapping the current row in
java.sql.ResultSet to OAuth2AuthorizationConsent. |
public JdbcOAuth2AuthorizationConsentService(org.springframework.jdbc.core.JdbcOperations jdbcOperations,
RegisteredClientRepository registeredClientRepository)
JdbcOAuth2AuthorizationConsentService using the provided parameters.jdbcOperations - the JDBC operationsregisteredClientRepository - the registered client repositorypublic void save(OAuth2AuthorizationConsent authorizationConsent)
OAuth2AuthorizationConsentServiceOAuth2AuthorizationConsent.save in interface OAuth2AuthorizationConsentServiceauthorizationConsent - the OAuth2AuthorizationConsentpublic void remove(OAuth2AuthorizationConsent authorizationConsent)
OAuth2AuthorizationConsentServiceOAuth2AuthorizationConsent.remove in interface OAuth2AuthorizationConsentServiceauthorizationConsent - the OAuth2AuthorizationConsent@Nullable public OAuth2AuthorizationConsent findById(java.lang.String registeredClientId, java.lang.String principalName)
OAuth2AuthorizationConsentServiceOAuth2AuthorizationConsent identified by the provided
registeredClientId and principalName, or null if not found.findById in interface OAuth2AuthorizationConsentServiceregisteredClientId - the identifier for the RegisteredClientprincipalName - the name of the PrincipalOAuth2AuthorizationConsent if found, otherwise nullpublic final void setAuthorizationConsentRowMapper(org.springframework.jdbc.core.RowMapper<OAuth2AuthorizationConsent> authorizationConsentRowMapper)
RowMapper used for mapping the current row in
java.sql.ResultSet to OAuth2AuthorizationConsent. The default is
JdbcOAuth2AuthorizationConsentService.OAuth2AuthorizationConsentRowMapper.authorizationConsentRowMapper - the RowMapper used for mapping the current
row in ResultSet to OAuth2AuthorizationConsentpublic final void setAuthorizationConsentParametersMapper(java.util.function.Function<OAuth2AuthorizationConsent,java.util.List<org.springframework.jdbc.core.SqlParameterValue>> authorizationConsentParametersMapper)
Function used for mapping OAuth2AuthorizationConsent to
a List of SqlParameterValue. The default is
JdbcOAuth2AuthorizationConsentService.OAuth2AuthorizationConsentParametersMapper.authorizationConsentParametersMapper - the Function used for mapping
OAuth2AuthorizationConsent to a List of SqlParameterValueprotected final org.springframework.jdbc.core.JdbcOperations getJdbcOperations()
protected final org.springframework.jdbc.core.RowMapper<OAuth2AuthorizationConsent> getAuthorizationConsentRowMapper()
protected final java.util.function.Function<OAuth2AuthorizationConsent,java.util.List<org.springframework.jdbc.core.SqlParameterValue>> getAuthorizationConsentParametersMapper()