@Override
 public ClientDetails loadClientByClientId(String clientId) {
   BaseClientDetails clientDetails = new BaseClientDetails();
   clientDetails.setClientId(CLIENT_ID);
   clientDetails.setClientSecret(CLIENT_SECRET);
   clientDetails.setAuthorizedGrantTypes(Arrays.asList(GRANT_TYPES));
   return clientDetails;
 }
Exemplo n.º 2
0
 private void createAppClient(RestOperations client) {
   BaseClientDetails clientDetails =
       new BaseClientDetails(
           "app",
           "none",
           "cloud_controller.read,openid,password.write",
           "password,authorization_code,refresh_token",
           "uaa.resource");
   clientDetails.setClientSecret("appclientsecret");
   createClient(client, testAccounts.getClientDetails("oauth.clients.app", clientDetails));
 }
Exemplo n.º 3
0
 private void createScimClient(RestOperations client) {
   BaseClientDetails clientDetails =
       new BaseClientDetails(
           "scim",
           "none",
           "uaa.none",
           "client_credentials",
           "scim.read,scim.write,password.write");
   clientDetails.setClientSecret("scimsecret");
   createClient(client, testAccounts.getClientDetails("oauth.clients.scim", clientDetails));
 }
 public BaseClientDetails(ClientDetails prototype) {
   this();
   setAccessTokenValiditySeconds(prototype.getAccessTokenValiditySeconds());
   setRefreshTokenValiditySeconds(prototype.getRefreshTokenValiditySeconds());
   setAuthorities(prototype.getAuthorities());
   setAuthorizedGrantTypes(prototype.getAuthorizedGrantTypes());
   setClientId(prototype.getClientId());
   setClientSecret(prototype.getClientSecret());
   setRegisteredRedirectUri(prototype.getRegisteredRedirectUri());
   setScope(prototype.getScope());
   setResourceIds(prototype.getResourceIds());
 }
 public ClientDetails mapRow(ResultSet rs, int rowNum) throws SQLException {
   BaseClientDetails details =
       new BaseClientDetails(
           rs.getString(1),
           rs.getString(3),
           rs.getString(4),
           rs.getString(5),
           rs.getString(7),
           rs.getString(6));
   details.setClientSecret(rs.getString(2));
   details.setAccessTokenValiditySeconds(rs.getInt(8));
   details.setRefreshTokenValiditySeconds(rs.getInt(9));
   String json = rs.getString(10);
   if (json != null) {
     try {
       @SuppressWarnings("unchecked")
       Map<String, Object> additionalInformation = mapper.readValue(json, Map.class);
       details.setAdditionalInformation(additionalInformation);
     } catch (Exception e) {
       logger.warn("Could not decode JSON for additional information: " + details, e);
     }
   }
   return details;
 }