If we need to use the JdbcOAuth2AuthorizedClientService, must create a table in the database. official oauth2_authorized_client table SQL is

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) );


PRIMARY KEY (client_registration_id, principal_name)

!! My problem is log in with a different ID but "client_registration_id" and "principal_name" are the same, the data will be overwritten

Ex. user : username / client_registration_id / principal_name user1 : bbbbbbbb / google / kim user2 : aaaaaaaaa / google / kim

Comment From: marcusdacoregio

Hi, @xxxjjhhh. The default schema file provided is aligned with the implementation provided by the framework, as the javadoc says:

NOTE: This OAuth2AuthorizedClientService depends on the table definition described in "classpath:org/springframework/security/oauth2/client/oauth2-client-schema.sql" and therefore MUST be defined in the database schema.

If you have different needs, you can provide your own OAuth2AuthorizedClientService implementation.

If you think I am missing something or there is a bug we can reopen this issue.

Comment From: xxxjjhhh

thx