spring-oauth-server/src/main/java/com/monkeyk/sos/domain/oauth/CustomJdbcClientDetailsServ...

29 lines
927 B
Java
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

package com.monkeyk.sos.domain.oauth;
import org.springframework.security.oauth2.provider.client.JdbcClientDetailsService;
import javax.sql.DataSource;
/**
* Add <i>archived = 0</i> condition
*
* @author Shengzhao Li
*/
public class CustomJdbcClientDetailsService extends JdbcClientDetailsService {
/**
* 扩展的查询SQL
* 增加逻辑删除 条件 archived = 0
*/
private static final String SELECT_CLIENT_DETAILS_SQL = "select client_id, client_secret, resource_ids, scope, authorized_grant_types, " +
"web_server_redirect_uri, authorities, access_token_validity, refresh_token_validity, additional_information, autoapprove " +
"from oauth_client_details where client_id = ? and archived = 0 ";
public CustomJdbcClientDetailsService(DataSource dataSource) {
super(dataSource);
setSelectClientDetailsSql(SELECT_CLIENT_DETAILS_SQL);
}
}