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

The following examples show how to use org.springframework.security.oauth2.config.annotation.configurers.ClientDetailsServiceConfigurer#jdbc() . 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: OAuth2Config.java    From spring-cloud-study with Apache License 2.0 6 votes vote down vote up
@Override
    public void configure(ClientDetailsServiceConfigurer clients) throws Exception {
        clients.jdbc(dataSource);

//        clients.inMemory()
//                .withClient("order-client")
//                .secret(passwordEncoder.encode("order-secret-8888"))
//                .authorizedGrantTypes("refresh_token", "authorization_code", "password")
//                .accessTokenValiditySeconds(3600)
//                .scopes("all")
//                .and()
//                .withClient("user-client")
//                .secret(passwordEncoder.encode("user-secret-8888"))
//                .authorizedGrantTypes("refresh_token", "authorization_code", "password")
//                .accessTokenValiditySeconds(3600)
//                .scopes("all");
    }
 
Example 2
Source File: OAuth2Config.java    From spring-microservices-in-action with Apache License 2.0 5 votes vote down vote up
@Override
    public void configure(ClientDetailsServiceConfigurer clients) throws Exception {            // Define what client applications are registered with the service
// Store in memory
//        clients.inMemory()                                                                      // Store the application information in memory
//                .withClient("eagleeye")                                                         // Specify which client application will register
//                .secret("thisissecret")                                                         // Specify the secret which will be used to get the access token
//                .authorizedGrantTypes("refresh_token", "password", "client_credentials")        // Provide a list of the authorization grant types that will be supported by the service
//                .scopes("webclient", "mobileclient");                                           // Define the types of the client applications can get the access token from the service
    	
// Store in database
    	clients.jdbc(dataSource);
    }
 
Example 3
Source File: AuthorizationServerConfiguration.java    From onetwo with Apache License 2.0 5 votes vote down vote up
protected void configJdbc(ClientDetailsServiceConfigurer clients) throws Exception{
	Assert.notNull(dataSource, "dataSource is required!");
	JdbcClientDetailsServiceBuilder b = clients.jdbc(dataSource);
	if(passwordEncoder!=null){
		b.passwordEncoder(passwordEncoder);
	}
	b.build();
}
 
Example 4
Source File: AuthorizationServerConfiguration.java    From lolibox with Apache License 2.0 5 votes vote down vote up
@Override
public void configure(ClientDetailsServiceConfigurer clients) throws Exception {
    // TODO Add JPA Builder
    JdbcClientDetailsServiceBuilder builder = clients
            .jdbc(ds);
    if (this.clients != null) {
        FinalValueHolder<ClientDetailsServiceBuilder> detailHolder = new FinalValueHolder<>(builder);
        this.clients.forEach(c -> detailHolder.setValue(detailHolder.getValue().withClient(c.getName()).secret(c.getSecret())
                .authorizedGrantTypes("password")
                .authorities("ROLE_CLIENT")
                .scopes("read", "write")
                .resourceIds("oauth2-resource")
                .accessTokenValiditySeconds(Integer.MAX_VALUE).and()));
    }
}
 
Example 5
Source File: AuthServerOAuth2Config.java    From Building-Web-Apps-with-Spring-5-and-Angular with MIT License 4 votes vote down vote up
@Override
   public void configure(final ClientDetailsServiceConfigurer clients) throws Exception {
	clients.jdbc(this.dataSource);
}
 
Example 6
Source File: AuthServerOAuth2Config.java    From Building-Web-Apps-with-Spring-5-and-Angular with MIT License 4 votes vote down vote up
@Override
   public void configure(final ClientDetailsServiceConfigurer clients) throws Exception {
	clients.jdbc(this.dataSource);
}
 
Example 7
Source File: AuthorizationServerConfiguration.java    From OAuth-2.0-Cookbook with MIT License 4 votes vote down vote up
@Override
public void configure(ClientDetailsServiceConfigurer clients) throws Exception {
    clients.jdbc(dataSource);
}
 
Example 8
Source File: OAuth2AuthorizationServer.java    From OAuth-2.0-Cookbook with MIT License 4 votes vote down vote up
@Override
public void configure(ClientDetailsServiceConfigurer clients)
        throws Exception {
    clients.jdbc(dataSource);
}
 
Example 9
Source File: JdbcOAuth2Config.java    From microservice-skeleton with MIT License 4 votes vote down vote up
@Override
public void configure(final ClientDetailsServiceConfigurer clients) throws Exception {
    clients.jdbc(dataSource);
}
 
Example 10
Source File: OAuth2AuthorizationServer.java    From OAuth-2.0-Cookbook with MIT License 4 votes vote down vote up
public void configure(ClientDetailsServiceConfigurer clients)
        throws Exception {
    clients.jdbc(dataSource);
}
 
Example 11
Source File: OAuth2AuthorizationServer.java    From OAuth-2.0-Cookbook with MIT License 4 votes vote down vote up
public void configure(ClientDetailsServiceConfigurer clients)
        throws Exception {
    clients.jdbc(dataSource);
}
 
Example 12
Source File: OAuth2AuthorizationServer.java    From OAuth-2.0-Cookbook with MIT License 4 votes vote down vote up
public void configure(ClientDetailsServiceConfigurer clients)
        throws Exception {
    clients.jdbc(dataSource);
}
 
Example 13
Source File: OAuth2Config.java    From auth-server with Apache License 2.0 4 votes vote down vote up
@Override
public void configure(ClientDetailsServiceConfigurer clients) throws Exception {
  clients.jdbc(dataSource);
}
 
Example 14
Source File: ApiBootAuthorizationServerJdbcAutoConfiguration.java    From beihu-boot with Apache License 2.0 4 votes vote down vote up
@Override
public void configure(ClientDetailsServiceConfigurer clients) throws Exception {
    clients.jdbc(dataSource);
}
 
Example 15
Source File: AuthenticationServerConfig.java    From JetfireCloud with Apache License 2.0 4 votes vote down vote up
@Override
public void configure(ClientDetailsServiceConfigurer clients) throws Exception {
    //配置客户端信息,从数据库中读取,对应oauth_client_details表
    clients.jdbc(dataSource);
}
 
Example 16
Source File: AuthorizationServerConfiguration.java    From oauth2lab with MIT License 4 votes vote down vote up
@Override
public void configure(ClientDetailsServiceConfigurer clients) throws Exception {
    clients.jdbc(dataSource);
}
 
Example 17
Source File: OAuth2AuthorizationServerConfig.java    From oauth2lab with MIT License 4 votes vote down vote up
@Override
public void configure(final ClientDetailsServiceConfigurer clients) throws Exception {
    clients.jdbc(dataSource());
}
 
Example 18
Source File: AuthorizationServerConfiguration.java    From watchdog-spring-boot-starter with MIT License 4 votes vote down vote up
@Override
public void configure(ClientDetailsServiceConfigurer clients) throws Exception {
    clients.jdbc(dataSource);
}
 
Example 19
Source File: AuthorizationServerConfig.java    From Spring with Apache License 2.0 4 votes vote down vote up
@Override
public void configure(ClientDetailsServiceConfigurer clients) throws Exception {
	clients.jdbc(dataSource());
}
 
Example 20
Source File: AuthorizationServerConfiguration.java    From spring-security with Apache License 2.0 2 votes vote down vote up
/**
 * 用来配置客户端详情服务(ClientDetailsService),客户端详情信息在这里进行初始化,你能够把客户端详情信息写死在这里或者是通过数据库来存储调取详情信息。
 *
 * @param clients
 * @throws Exception
 */
@Override
public void configure(ClientDetailsServiceConfigurer clients) throws Exception {
    clients.jdbc(dataSource);
}