org.springframework.security.oauth2.config.annotation.builders.JdbcClientDetailsServiceBuilder Java Examples
The following examples show how to use
org.springframework.security.oauth2.config.annotation.builders.JdbcClientDetailsServiceBuilder.
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: AuthorizationServerConfiguration.java From onetwo with Apache License 2.0 | 5 votes |
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 File: AuthorizationServerConfiguration.java From lolibox with Apache License 2.0 | 5 votes |
@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())); } }