Java Code Examples for org.springframework.security.oauth2.config.annotation.builders.JdbcClientDetailsServiceBuilder

The following examples show how to use org.springframework.security.oauth2.config.annotation.builders.JdbcClientDetailsServiceBuilder. 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: onetwo   Source File: AuthorizationServerConfiguration.java    License: 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 2
Source Project: lolibox   Source File: AuthorizationServerConfiguration.java    License: 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()));
    }
}