Java Client for Cloud Foundry UAA

The Cloud Foundry User Account and Authentication (UAA) service is a set of JSON APIs to manage user accounts, user groups, and OAuth2 clients. This project aims to be an easy-to-use and feature complete Java library for these APIs.

Quick Start

Note: this library only works with UAA 2.1.0 and later. Versions prior to 2.1.0 should use the 1.0.0-RELEASE tag, which has been tested with 2.0 and later, but should work with 1.9 and later. Be warned that the object model has changed significantly from the 1.0.0-RELEASE tag to use existing objects rather than custom POJOs.

$ git clone
$ mvn package

Running Tests

While the test goal of the Maven project should always complete successfully, certain tests do require a local UAA server to be running for them to pass. If a UAA server is not running on port 8080, the tests will be skipped. To run a copy of the UAA on port 8080, follow the Quick Start guide for the UAA. The tests expect a clean UAA database as bootstrapped by the server, so if a test fails, simply restart the UAA server and you should be back in a clean state.

Getting Started in code


import org.cloudfoundry.identity.uaa.api.UaaConnectionFactory;
import org.cloudfoundry.identity.uaa.api.common.UaaConnection;
import org.cloudfoundry.identity.uaa.api.common.model.expr.FilterRequestBuilder;
import org.cloudfoundry.identity.uaa.api.user.UaaUserOperations;
import org.cloudfoundry.identity.uaa.scim.ScimUser;

public class GetUsersNamedJohn {
  public static void main(String[] args) throws Exception {

    ResourceOwnerPasswordResourceDetails credentials = new ResourceOwnerPasswordResourceDetails();

    URL uaaHost = new URL("http://localhost:8080/uaa");
    UaaConnection connection = UaaConnectionFactory.getConnection(uaaHost, credentials);
    UaaUserOperations operations = connection.userOperations();

    FilterRequestBuilder builder = new FilterRequestBuilder();
    builder.startsWith("username", "john.");

    SearchResults<ScimUser> results = operations.getUsers(;
    for (ScimUser user : results.getResources()) {

More Information

Javadoc is available by building the code (or by running mvn javadoc:javadoc). Authoratative information about the UAA is located here


Pull requests are welcome! Current to-dos including writing test cases for group mapping APIs and making it easier for test cases to point to an existing UAA server.