Skip to content

Provide JDBC implementation of OAuth2AuthorizedClientService #7655

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jgrandja opened this issue Nov 18, 2019 · 0 comments
Closed

Provide JDBC implementation of OAuth2AuthorizedClientService #7655

jgrandja opened this issue Nov 18, 2019 · 0 comments
Assignees
Labels
in: oauth2 An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose) type: enhancement A general enhancement
Milestone

Comments

@jgrandja
Copy link
Contributor

jgrandja commented Nov 18, 2019

We should provide a JDBC implementation of OAuth2AuthorizedClientService.

Related #7889

JdbcOAuth2AuthorizedClientService may be configured as follows:

@Bean
public OAuth2AuthorizedClientService authorizedClientService(
		JdbcOperations jdbcOperations,
		ClientRegistrationRepository clientRegistrationRepository) {
	return new JdbcOAuth2AuthorizedClientService(jdbcOperations, clientRegistrationRepository);
}

NOTE: JdbcOperations must be provided by the application and configured with a database schema that has the following table definition:

CREATE TABLE oauth2_authorized_client (
  client_registration_id varchar(100) NOT NULL,
  principal_name varchar(200) NOT NULL,
  access_token_type varchar(100) NOT NULL,
  access_token_value blob NOT NULL,
  access_token_issued_at timestamp NOT NULL,
  access_token_expires_at timestamp NOT NULL,
  access_token_scopes varchar(1000) DEFAULT NULL,
  refresh_token_value blob DEFAULT NULL,
  refresh_token_issued_at timestamp DEFAULT NULL,
  created_at timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL,
  PRIMARY KEY (client_registration_id, principal_name)
);

See classpath:org/springframework/security/oauth2/client/oauth2-client-schema.sql.

@jgrandja jgrandja self-assigned this Nov 18, 2019
@jgrandja jgrandja added in: oauth2 An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose) type: enhancement A general enhancement labels Nov 18, 2019
@jgrandja jgrandja added this to the 5.3.x milestone Nov 18, 2019
@jgrandja jgrandja modified the milestones: 5.3.x, 5.3.0.RC1 Jan 19, 2020
jgrandja added a commit to jgrandja/spring-security that referenced this issue Jan 22, 2020
@eleftherias eleftherias modified the milestones: 5.3.0.RC1, 5.3.0 Feb 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: oauth2 An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose) type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants