Java Code Examples for org.springframework.security.oauth2.config.annotation.configurers.ClientDetailsServiceConfigurer#withClientDetails()

The following examples show how to use org.springframework.security.oauth2.config.annotation.configurers.ClientDetailsServiceConfigurer#withClientDetails() . 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 File: OAuth2ServerConfig.java    From open-capacity-platform with Apache License 2.0 6 votes vote down vote up
/**
 * 配置应用名称 应用id
 * 配置OAuth2的客户端相关信息
 */
@Override
public void configure(ClientDetailsServiceConfigurer clients) throws Exception {

    // if(clientDetailsService!=null){
    // clients.withClientDetails(clientDetailsService);
    // }else{
    // clients.inMemory().withClient("neusoft1").secret("neusoft1")
    // .authorizedGrantTypes("authorization_code", "password",
    // "refresh_token").scopes("all")
    // .resourceIds(SERVER_RESOURCE_ID).accessTokenValiditySeconds(1200)
    // .refreshTokenValiditySeconds(50000)
    // .and().withClient("neusoft2").secret("neusoft2")
    // .authorizedGrantTypes("authorization_code", "password",
    // "refresh_token").scopes("all")
    // .resourceIds(SERVER_RESOURCE_ID).accessTokenValiditySeconds(1200)
    // .refreshTokenValiditySeconds(50000)
    // ;
    // }
    clients.withClientDetails(redisClientDetailsService);
    redisClientDetailsService.loadAllClientToCache();
}
 
Example 2
Source File: OAuth2AuthorizationServerConfig.java    From NFVO with Apache License 2.0 5 votes vote down vote up
@Override
public void configure(ClientDetailsServiceConfigurer client) throws Exception {
  customClientDetailsService = new CustomClientDetailsService();
  BaseClientDetails openbatonOSClient = buildOpenBatonOSClient();
  customClientDetailsService.addclientDetails(openbatonOSClient);
  client.withClientDetails(customClientDetailsService);
}
 
Example 3
Source File: AuthorizationServerConfiguration.java    From onetwo with Apache License 2.0 5 votes vote down vote up
@Override
public void configure(ClientDetailsServiceConfigurer clients) throws Exception {
	if(clientDetailsService!=null){
		clients.withClientDetails(clientDetailsService);
		return ;
	}
	ClientDetailStore store = oauth2Properties.getAuthorizationServer().getClientDetailStore();
	if(store==ClientDetailStore.JDBC){
		configJdbc(clients);
	}else if(store==ClientDetailStore.IN_MEMORY){
		configInMemory(clients);
	}
}
 
Example 4
Source File: AuthorizationServerConfig.java    From cloud-service with MIT License 5 votes vote down vote up
/**
     * 我们将client信息存储到oauth_client_details表里<br>
     * 并将数据缓存到redis
     *
     * @param clients
     * @throws Exception
     */
    @Override
    public void configure(ClientDetailsServiceConfigurer clients) throws Exception {
//		clients.inMemory().withClient("system").secret(bCryptPasswordEncoder.encode("system"))
//				.authorizedGrantTypes("password", "authorization_code", "refresh_token").scopes("app")
//				.accessTokenValiditySeconds(3600);

//		clients.jdbc(dataSource);
        // 2019.06.06,这里优化一下,详细看下redisClientDetailsService这个实现类
        clients.withClientDetails(redisClientDetailsService);
        redisClientDetailsService.loadAllClientToCache();
    }
 
Example 5
Source File: AuthorizationServerConfig.java    From cloud-template with MIT License 5 votes vote down vote up
@Override
public void configure(ClientDetailsServiceConfigurer clients) throws Exception {
    /**
     * 基于JDBC的储存方式
     * 对应查询`oauth_client_details`表中的客户端信息
     */
    clients.withClientDetails(clientDetailsService());
}
 
Example 6
Source File: PigAuthorizationConfig.java    From pig with 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 7
Source File: OAuth2AuthorizationServerConfig.java    From oauth-boot with MIT License 4 votes vote down vote up
@Override
public void configure(ClientDetailsServiceConfigurer clients) throws Exception {
    // 配置加载客户端的service
    clients.withClientDetails(clientDetailsService);
}
 
Example 8
Source File: AuthorizationServerConfig.java    From platform with Apache License 2.0 4 votes vote down vote up
@Override
public void configure(ClientDetailsServiceConfigurer clients) throws Exception {
    clients.withClientDetails(clientDetailsService());
}
 
Example 9
Source File: AuthorizationServerConfig.java    From oauth-server with Apache License 2.0 4 votes vote down vote up
/**
 * 配置客户端详情服务,客户端详情信息在这里进行初始化
 */
@Override
public void configure(ClientDetailsServiceConfigurer clients) throws Exception {
    clients.withClientDetails(clientDetailsService);
}
 
Example 10
Source File: AuthorizationServerConfiguration.java    From cola with MIT License 4 votes vote down vote up
@Override
public void configure(ClientDetailsServiceConfigurer clients) throws Exception {
	clients.withClientDetails(jdbcClientDetailsService());
}
 
Example 11
Source File: AuthorizationServerConfiguration.java    From spring-boot-samples with Apache License 2.0 4 votes vote down vote up
@Override
public void configure(ClientDetailsServiceConfigurer clients) throws Exception {
    // 读取客户端配置
    clients.withClientDetails(jdbcClientDetails());
}
 
Example 12
Source File: AuthorizationSeverConfig.java    From springboot-vue.js-bbs with Apache License 2.0 4 votes vote down vote up
@Override
public void configure(ClientDetailsServiceConfigurer clients) throws Exception {
    clients.withClientDetails(clientDetailsService());
}
 
Example 13
Source File: AuthorizationServerConfiguration.java    From open-cloud with MIT License 4 votes vote down vote up
@Override
public void configure(ClientDetailsServiceConfigurer clients) throws Exception {
    clients.withClientDetails(customClientDetailsService);
}
 
Example 14
Source File: AuthorizationServerConfiguration.java    From entando-core with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
public void configure(ClientDetailsServiceConfigurer clients) throws Exception {
    clients.withClientDetails(this.clientDetailsService);
}
 
Example 15
Source File: OAuth2Config.java    From microservice-integration with MIT License 4 votes vote down vote up
@Override
public void configure(ClientDetailsServiceConfigurer clients) throws Exception {
    clients.withClientDetails(jdbcClientDetailsService(dataSource));
}
 
Example 16
Source File: AuthorizationServerConfig.java    From pacbot with Apache License 2.0 4 votes vote down vote up
@Override
public void configure(ClientDetailsServiceConfigurer clients) throws Exception {
    clients.withClientDetails(clientDetailsService());
}
 
Example 17
Source File: AuthorizationServerConfiguration.java    From cola-cloud with MIT License 4 votes vote down vote up
@Override
public void configure(ClientDetailsServiceConfigurer clients) throws Exception {
    // TODO persist clients details
    clients.withClientDetails(redisClientDetailsService);
}
 
Example 18
Source File: OAuth2Config.java    From konker-platform with Apache License 2.0 4 votes vote down vote up
@Override
public void configure(ClientDetailsServiceConfigurer clients) throws Exception {
	clients.withClientDetails(clientDetailsService);
}
 
Example 19
Source File: AuthorizationServerConfig.java    From microservices-platform with Apache License 2.0 2 votes vote down vote up
/**
 * 配置应用名称 应用id
 * 配置OAuth2的客户端相关信息
 * @param clients
 * @throws Exception
 */
@Override
public void configure(ClientDetailsServiceConfigurer clients) throws Exception {
    clients.withClientDetails(clientDetailsService);
    clientDetailsService.loadAllClientToCache();
}
 
Example 20
Source File: AuthorizationConfig.java    From springcloud-oauth2 with MIT License votes vote down vote up
/**
     * 配置客户端详情
     * @param clients
     * @throws Exception
     */
    @Override
    public void configure(ClientDetailsServiceConfigurer clients) throws Exception {
        clients.withClientDetails(clientDetailsService);
    }