Java Code Examples for org.springframework.security.oauth2.provider.client.JdbcClientDetailsService

The following examples show how to use org.springframework.security.oauth2.provider.client.JdbcClientDetailsService. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: syhthems-platform   Source File: JdbcClientDetailsServiceConfig.java    License: MIT License 5 votes vote down vote up
@Bean
@Primary
public ClientDetailsService jdbcClientDetailsService() {
    JdbcClientDetailsService clientDetailsService = new JdbcClientDetailsService(dataSource);
    clientDetailsService.setPasswordEncoder(passwordEncoder);
    return clientDetailsService;
}
 
Example 2
Source Project: black-shop   Source File: AuthorizationServerConfig.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * 设置client去数据库读取信息.
 *
 * @param clients the clients
 * @throws Exception the exception
 */
@Override
@SneakyThrows
public void configure(ClientDetailsServiceConfigurer clients) {
	JdbcClientDetailsService jdbcClientDetailsService = new JdbcClientDetailsService(dataSource);
	jdbcClientDetailsService.setSelectClientDetailsSql(SecurityConstants.DEFAULT_SELECT_STATEMENT);
	jdbcClientDetailsService.setFindClientDetailsSql(SecurityConstants.DEFAULT_FIND_STATEMENT);
	clients.withClientDetails(jdbcClientDetailsService);
}
 
Example 3
Source Project: pig   Source File: PigAuthorizationConfig.java    License: MIT License 5 votes vote down vote up
@Override
public void configure(ClientDetailsServiceConfigurer clients) throws Exception {
    JdbcClientDetailsService clientDetailsService = new JdbcClientDetailsService(dataSource);
    clientDetailsService.setSelectClientDetailsSql(SecurityConstants.DEFAULT_SELECT_STATEMENT);
    clientDetailsService.setFindClientDetailsSql(SecurityConstants.DEFAULT_FIND_STATEMENT);
    clients.withClientDetails(clientDetailsService);
}
 
Example 4
Source Project: onetwo   Source File: AbstractOAuth2ClientDetailsService.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void afterPropertiesSet() throws Exception {
	if(jdbcClientDetailsService==null){
		Assert.notNull(dataSource, "dataSource can not be null!");
		this.jdbcClientDetailsService = new JdbcClientDetailsService(dataSource);
		return ;
	}
	Assert.notNull(jdbcClientDetailsService, "jdbcClientDetailsService can not be null!");
}
 
Example 5
@Bean
public ClientDetailsService clientDetails() {
    return new JdbcClientDetailsService(dataSource);
}
 
Example 6
@Bean
public ClientDetailsService jdbcClientDetailsService() {
    // 基于 JDBC 实现,需要事先在数据库配置客户端信息
    return new JdbcClientDetailsService(dataSource());
}
 
Example 7
Source Project: cloud-template   Source File: AuthorizationServerConfig.java    License: MIT License 4 votes vote down vote up
@Bean
public ClientDetailsService clientDetailsService() {
    return new JdbcClientDetailsService(dataSource());
}
 
Example 8
Source Project: open-cloud   Source File: ResourceServerConfiguration.java    License: MIT License 4 votes vote down vote up
@Bean
public JdbcClientDetailsService clientDetailsService() {
    JdbcClientDetailsService jdbcClientDetailsService = new JdbcClientDetailsService(dataSource);
    jdbcClientDetailsService.setPasswordEncoder(passwordEncoder);
    return jdbcClientDetailsService;
}
 
Example 9
@Bean
public ClientDetailsService jdbcClientDetails() {
    // 基于 JDBC 实现,需要事先在数据库配置客户端信息
    return new JdbcClientDetailsService(dataSource());
}
 
Example 10
Source Project: cola   Source File: AuthorizationServerConfiguration.java    License: MIT License 4 votes vote down vote up
@Bean
public JdbcClientDetailsService jdbcClientDetailsService() {
	return new JdbcClientDetailsService(dataSource);
}
 
Example 11
@Bean
public ClientDetailsService clientDetails() {
    return new JdbcClientDetailsService(dataSource);
}
 
Example 12
Source Project: pacbot   Source File: AuthorizationServerConfig.java    License: Apache License 2.0 4 votes vote down vote up
@Bean
public JdbcClientDetailsService clientDetailsService() {
    return new JdbcClientDetailsService(dataSource);
}
 
Example 13
Source Project: oauth2lab   Source File: OAuth2Configuration.java    License: MIT License 4 votes vote down vote up
@Bean
public ClientDetailsService clientDetailsService() {
    return new JdbcClientDetailsService(dataSource);
}
 
Example 14
Source Project: java-tutorial   Source File: AuthorizationServerConfig.java    License: MIT License 4 votes vote down vote up
@Bean
public ClientDetailsService clientDetails() {
    JdbcClientDetailsService jdbcClientDetailsService = new JdbcClientDetailsService(dataSource);
    jdbcClientDetailsService.setPasswordEncoder(new BCryptPasswordEncoder());
    return jdbcClientDetailsService;
}
 
Example 15
Source Project: spring-cloud-shop   Source File: OAuth2SecurityConfiguration.java    License: MIT License 4 votes vote down vote up
@Bean
public ClientDetailsService clientDetails() {
    return new JdbcClientDetailsService(dataSource);
}
 
Example 16
Source Project: lion   Source File: AuthorizationServerConfig.java    License: Apache License 2.0 4 votes vote down vote up
@Bean
public ClientDetailsService clientDetails() {
    return new JdbcClientDetailsService(dataSource);
}
 
Example 17
Source Project: OAuth-2.0-Cookbook   Source File: OAuth2AuthorizationServer.java    License: MIT License 4 votes vote down vote up
@Bean
public ClientRegistrationService clientRegistrationService() {
    return new JdbcClientDetailsService(dataSource);
}
 
Example 18
Source Project: OAuth-2.0-Cookbook   Source File: OAuth2AuthorizationServer.java    License: MIT License 4 votes vote down vote up
@Bean
public ClientRegistrationService clientRegistrationService() {
    return new JdbcClientDetailsService(dataSource);
}
 
Example 19
Source Project: OAuth-2.0-Cookbook   Source File: OAuth2Configuration.java    License: MIT License 4 votes vote down vote up
@Bean
public ClientDetailsService clientDetailsService() {
    return new JdbcClientDetailsService(dataSource);
}
 
Example 20
Source Project: DAFramework   Source File: WebSecurityConfiguration.java    License: MIT License 4 votes vote down vote up
@Bean
public ClientDetailsService jdbcClientDetailsService() {
	return new JdbcClientDetailsService(dataSource);
}
 
Example 21
Source Project: Auth-service   Source File: OAuth2Config.java    License: MIT License 4 votes vote down vote up
@Bean
public JdbcClientDetailsService clientDetailsService() {
    return new JdbcClientDetailsService(dataSource);
}
 
Example 22
@Bean
@Primary
public ClientDetailsService clientDetailsService() {
    return new JdbcClientDetailsService(dataSource);
}
 
Example 23
Source Project: microservice-integration   Source File: OAuth2Config.java    License: MIT License 4 votes vote down vote up
@Bean
public JdbcClientDetailsService jdbcClientDetailsService(DataSource dataSource) {
    return new JdbcClientDetailsService(dataSource);
}
 
Example 24
Source Project: onetwo   Source File: AbstractOAuth2ClientDetailsService.java    License: Apache License 2.0 4 votes vote down vote up
public void setJdbcClientDetailsService(JdbcClientDetailsService jdbcClientDetailsService) {
	this.jdbcClientDetailsService = jdbcClientDetailsService;
}
 
Example 25
Source Project: onetwo   Source File: AbstractOAuth2ClientDetailsService.java    License: Apache License 2.0 4 votes vote down vote up
public JdbcClientDetailsService getJdbcClientDetailsService() {
	return jdbcClientDetailsService;
}
 
Example 26
Source Project: spring-oauth-example   Source File: ClientController.java    License: MIT License 4 votes vote down vote up
public ClientController(JdbcClientDetailsService clientDetailsService) {
    this.clientDetailsService = clientDetailsService;
}
 
Example 27
Source Project: spring-oauth-example   Source File: IndexController.java    License: MIT License 4 votes vote down vote up
public IndexController(JdbcClientDetailsService clientDetailsService, ApprovalStore approvalStore, TokenStore tokenStore) {
    this.clientDetailsService = clientDetailsService;
    this.approvalStore = approvalStore;
    this.tokenStore = tokenStore;
}
 
Example 28
Source Project: omh-dsu-ri   Source File: JdbcOAuth2SupportConfiguration.java    License: Apache License 2.0 4 votes vote down vote up
/**
 * @return the service used to retrieve OAuth2 client details
 */
@Bean
public ClientDetailsService clientDetailsService() {

    return new JdbcClientDetailsService(dataSource);
}
 
Example 29
/**
 * 声明 ClientDetails实现
 *
 * @return ClientDetailsService
 */
@Bean
public ClientDetailsService clientDetails() {
    return new JdbcClientDetailsService(dataSource);
}
 
Example 30
Source Project: spring-oauth-example   Source File: OAuthConfiguration.java    License: MIT License 2 votes vote down vote up
/**
 * We expose the JdbcClientDetailsService because it has extra methods that the Interface does not have. E.g.
 * {@link org.springframework.security.oauth2.provider.client.JdbcClientDetailsService#listClientDetails()} which we need for the
 * admin page.
 */
@Bean
public JdbcClientDetailsService clientDetailsService() {
    return new JdbcClientDetailsService(oauthDataSource());
}