UAA model

Cloud Foundry User Account and Authentication (UAA) Server

License

License

Categories

Categories

IDE Development Tools
GroupId

GroupId

org.cloudfoundry.identity
ArtifactId

ArtifactId

cloudfoundry-identity-model
Last Version

Last Version

4.30.0
Release Date

Release Date

Type

Type

jar
Description

Description

UAA model
Cloud Foundry User Account and Authentication (UAA) Server
Project URL

Project URL

https://github.com/cloudfoundry/uaa
Source Code Management

Source Code Management

https://github.com/cloudfoundry/uaa

Download cloudfoundry-identity-model

How to add to project

<!-- https://jarcasting.com/artifacts/org.cloudfoundry.identity/cloudfoundry-identity-model/ -->
<dependency>
    <groupId>org.cloudfoundry.identity</groupId>
    <artifactId>cloudfoundry-identity-model</artifactId>
    <version>4.30.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.cloudfoundry.identity/cloudfoundry-identity-model/
implementation 'org.cloudfoundry.identity:cloudfoundry-identity-model:4.30.0'
// https://jarcasting.com/artifacts/org.cloudfoundry.identity/cloudfoundry-identity-model/
implementation ("org.cloudfoundry.identity:cloudfoundry-identity-model:4.30.0")
'org.cloudfoundry.identity:cloudfoundry-identity-model:jar:4.30.0'
<dependency org="org.cloudfoundry.identity" name="cloudfoundry-identity-model" rev="4.30.0">
  <artifact name="cloudfoundry-identity-model" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.cloudfoundry.identity', module='cloudfoundry-identity-model', version='4.30.0')
)
libraryDependencies += "org.cloudfoundry.identity" % "cloudfoundry-identity-model" % "4.30.0"
[org.cloudfoundry.identity/cloudfoundry-identity-model "4.30.0"]

Dependencies

compile (8)

Group / Artifact Type Version
org.cloudfoundry.identity : cloudfoundry-identity-metrics-data jar 4.30.0
javax.validation : validation-api jar 2.0.1.Final
commons-io : commons-io jar 2.6
org.springframework : spring-web jar 4.3.22.RELEASE
org.springframework : spring-webmvc jar 4.3.22.RELEASE
org.springframework.security : spring-security-config jar 4.2.11.RELEASE
org.springframework.security.oauth : spring-security-oauth2 jar 2.3.0.RELEASE
org.slf4j : slf4j-api jar 1.7.25

test (8)

Group / Artifact Type Version
com.github.sbrannen » spring-test-junit5 jar 1.2.0
org.junit.jupiter : junit-jupiter-api jar 5.2.0
org.junit.jupiter : junit-jupiter-params jar 5.2.0
org.hamcrest : hamcrest-all jar 1.3
io.honeycomb.libhoney : libhoney-java jar 1.0.2
junit : junit jar 4.12
org.junit.jupiter : junit-jupiter-engine jar 5.2.0
org.junit.vintage : junit-vintage-engine jar 5.2.0

Project Modules

There are no modules declared in this project.

CloudFoundry User Account and Authentication (UAA) Server

The UAA is a multi tenant identity management service, used in Cloud Foundry, but also available as a stand alone OAuth2 server. Its primary role is as an OAuth2 provider, issuing tokens for client applications to use when they act on behalf of Cloud Foundry users. It can also authenticate users with their Cloud Foundry credentials, and can act as an SSO service using those credentials (or others). It has endpoints for managing user accounts and for registering OAuth2 clients, as well as various other management functions.

UAA Server

The authentication service is uaa. It's a plain Spring MVC webapp. Deploy as normal in Tomcat or your container of choice, or execute ./gradlew run to run it directly from uaa directory in the source tree. When running with gradle it listens on port 8080 and the URL is http://localhost:8080/uaa

The UAA Server supports the APIs defined in the UAA-APIs document. To summarise:

  1. The OAuth2 /oauth/authorize and /oauth/token endpoints

  2. A /login_info endpoint to allow querying for required login prompts

  3. A /check_token endpoint, to allow resource servers to obtain information about an access token submitted by an OAuth2 client.

  4. A /token_key endpoint, to allow resource servers to obtain the verification key to verify token signatures

  5. SCIM user provisioning endpoint

  6. OpenID connect endpoints to support authentication /userinfo. Partial OpenID support.

Authentication can be performed by command line clients by submitting credentials directly to the /oauth/authorize endpoint (as described in UAA-API doc). There is an ImplicitAccessTokenProvider in Spring Security OAuth that can do the heavy lifting if your client is Java.

Use Cases

  1. Authenticate

     GET /login
    

    A basic form login interface.

  2. Approve OAuth2 token grant

     GET /oauth/authorize?client_id=app&response_type=code...
    

    Standard OAuth2 Authorization Endpoint.

  3. Obtain access token

     POST /oauth/token
    

    Standard OAuth2 Authorization Endpoint.

Co-ordinates

Quick Start

Requirements:

  • Java 11

If this works you are in business:

$ git clone git://github.com/cloudfoundry/uaa.git
$ cd uaa
$ ./gradlew run

The apps all work together with the apps running on the same port (8080) as /uaa, /app and /api.

UAA will log to a file called uaa.log which can be found using the following command:-

$ sudo lsof | grep uaa.log

which you should find under something like:-

$TMPDIR/cargo/conf/logs/

Demo of command line usage on local server

First run the UAA server as described above:

$ ./gradlew run

From another terminal you can use curl to verify that UAA has started by requesting system information:

$ curl -H "Accept: application/json" localhost:8080/uaa/login
{
  "timestamp":"2012-03-28T18:25:49+0100",
  "commit_id":"111274e",
  "prompts":{"username":["text","Username"],
    "password":["password","Password"]
  }
}

For complex requests it is more convenient to interact with UAA using uaac, the UAA Command Line Client.

Integration tests

You can run the integration tests with docker

$ run-integration-tests.sh <dbtype>

will create a docker container running uaa + ldap + database whereby integration tests are run against.

Using Gradle to test with postgresql or mysql

The default uaa unit tests (./gradlew test integrationTest) use hsqldb.

To run the unit tests with docker:

$ run-unit-tests.sh <dbtype>

To run a single test

Start by finding out which gradle project your test belongs to. You can find all project by running

$ ./gradlew projects

Then you can run

$ ./gradlew :<project name>:test --tests <TestClass>.<MethodName>

or to run all tests in a Class

$ ./gradlew :<project name>:test --tests <TestClass>

You might want to use the full gradle command found at the bottom of the scripts/unit-tests.sh script by prepending the project name to the test command and adding the --tests option.

Building war file

$ ./gradlew :clean :assemble -Pversion=${UAA_VERSION}

Inventory

There are actually several projects here, the main uaa server application, a client library and some samples:

  1. uaa a WAR project for easy deployment

  2. server a JAR project containing the implementation of UAA's REST API (including SCIM) and UI

  3. model a JAR project used by both the client library and server

  4. api (sample) is an OAuth2 resource service which returns a mock list of deployed apps

  5. app (sample) is a user application that uses both of the above

In CloudFoundry terms

  • uaa provides an authentication service plus authorized delegation for back-end services and apps (by issuing OAuth2 access tokens).

  • api is a service that provides resources that other applications may wish to access on behalf of the resource owner (the end user).

  • app is a webapp that needs single sign on and access to the api service on behalf of users.

Running the UAA on Kubernetes

Prerequisites

The Kubernetes deployment is in active development. You should expect frequent (and possibly breaking) changes. This section will be updated as progress is made on this feature set. As of now:

The K8s directory contains ytt templates that can be rendered and applied to a K8s cluster.

In development, this Makefile can be used for common rendering and deployment activities.

In production, you'll most likely want to use ytt directly. Something like this should get you going:

$ ytt -f templates -f values/default-values.yml | kubectl apply -f -

If you'd like to overide some of those values, you can do so by taking advantage of YTT's overlay functionality.

$ ytt -f templates -f values/default-values.yml -f your-dir/production-values.yml | kubectl apply -f -

Of course, you can always abandon the default values altogether and provide your own values file.

Contributing to the UAA

Here are some ways for you to get involved in the community:

  • Create github tickets for bugs and new features and comment and vote on the ones that you are interested in.
  • Github is for social coding: if you want to write code, we encourage contributions through pull requests from forks of this repository. If you want to contribute code this way, please reference an existing issue if there is one as well covering the specific issue you are addressing. Always submit pull requests to the "develop" branch. We strictly adhere to test driven development. We kindly ask that pull requests are accompanied with test cases that would be failing if ran separately from the pull request.
org.cloudfoundry.identity

Cloud Foundry

Cloud Foundry Foundation active projects

Versions

Version
4.30.0
4.27.0
4.26.0
4.25.0
4.24.0
4.23.0
4.22.0
4.21.0
4.20.0
4.19.2
4.19.0
4.18.0
4.17.0
4.16.0
4.15.0
4.14.0
4.13.4
4.13.3
4.13.1
4.13.0
4.12.4
4.12.3
4.12.2
4.12.1
4.12.0
4.11.0
4.10.2
4.10.1
4.10.0
4.9.0
4.8.3
4.8.2
4.8.0
4.7.6
4.7.5
4.7.4
4.7.2
4.7.1
4.7.0
4.6.1
4.6.0
4.5.9
4.5.8
4.5.7
4.5.6
4.5.0
4.4.0
4.3.0
4.2.0
4.1.0
3.20.0
3.19.0
3.18.0
3.16.0
3.15.0
3.13.0
3.12.0
3.10.0
3.9.1
3.9.0
3.8.0
3.7.3
3.7.0
3.6.0
3.5.0
3.4.5
3.4.4
3.4.3
3.4.2
3.4.0
3.3.0.5
3.3.0.4
3.3.0.3
3.3.0.2
3.3.0.1
3.3.0
3.2.1
3.2.0
3.1.0
3.0.1
3.0.0