Examples of JdbcClientDetailsService


Examples of org.springframework.security.oauth2.provider.client.JdbcClientDetailsService

  public void setUp() throws Exception {
    // creates a HSQL in-memory db populated from default scripts
    // classpath:schema.sql and classpath:data.sql
    db = new EmbeddedDatabaseBuilder().addDefaultScripts().build();
    jdbcTemplate = new JdbcTemplate(db);
    service = new JdbcClientDetailsService(db);
  }
View Full Code Here

Examples of org.springframework.security.oauth2.provider.client.JdbcClientDetailsService

  public void testLoadingClientIdWithSingleDetailsInCustomTable() {
    jdbcTemplate.update(CUSTOM_INSERT_SQL, "clientIdWithSingleDetails",
        "mySecret", "myResource", "myScope", "myAuthorizedGrantType",
        "myRedirectUri", "myAuthority");

    JdbcClientDetailsService customService = new JdbcClientDetailsService(
        db);
    customService
        .setSelectClientDetailsSql("select appId, appSecret, resourceIds, scope, "
            + "grantTypes, redirectUrl, authorities, access_token_validity, refresh_token_validity, additionalInformation, autoApproveScopes from ClientDetails where appId = ?");

    ClientDetails clientDetails = customService
        .loadClientByClientId("clientIdWithSingleDetails");

    assertEquals("clientIdWithSingleDetails", clientDetails.getClientId());
    assertTrue(clientDetails.isSecretRequired());
    assertEquals("mySecret", clientDetails.getClientSecret());
View Full Code Here

Examples of org.springframework.security.oauth2.provider.client.JdbcClientDetailsService

    @Autowired
    private DataSource dataSource;

    @Bean
    public JdbcClientDetailsService clientDetailsService() {
      return new JdbcClientDetailsService(dataSource);
    }
View Full Code Here

Examples of org.springframework.security.oauth2.provider.client.JdbcClientDetailsService

  }

  @Override
  protected ClientDetailsService performBuild() {
    Assert.state(dataSource!=null, "You need to provide a DataSource");
    JdbcClientDetailsService clientDetailsService = new JdbcClientDetailsService(dataSource);
    for (ClientDetails client : clientDetails) {
      clientDetailsService.addClientDetails(client);
    }
    return clientDetailsService;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.