Skip to content

Qarik-Group/ultimate-guide-to-uaa-examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Example applications using Cloud Foundry UAA

This repository attempts to implement a series of similar example applications, in different programming languages.

Currently, the applications are implmented in:

The sample applications:

  • Resource Server - A simple API that provides a list of Australian airports. Guests only receive 10 results. Authenticated users receive more. Users who have specific UAA claims/scopes can receive all the results.
  • Resource Server CLI - A CLI for interacting with the above Resource Server.
  • Resource Server Web UI - A frontend wrapper UI for the backend Resource Server: a map showing Australian airports. Guest users see only 10 airports. Once a user has been authenticated via your UAA, they will begin to see more airports. Add the user to the airports.all group and they will be authorized to see all the airports.

Deploy UAA

You can run these example applications and integrate with any UAA.

The tutorials makes some small assumptions that you're using either uaa-deployment-cf or uaa-deployment for deployment and setting up local env vars.

The former makes it easy to deploy a secure, production-grade UAA to your Cloud Foundry using cf push. The latter makes it easy to deploy a secure, production-grade UAA to any target cloud using bosh create-env. Both tools provide a u CLI with a matching set of subcommands. To deploy your UAA, install and setup the uaa CLI, and setup local environment variables for the example applications:

cd ~/workspace/uaa-deployment*/
source <(bin/u env)
u up
source <(bin/u env)
u auth-client

The example applications' tutorials assume that either of the two u up projects are cloned into the ~/workspace/uaa-deployment-cf or ~/workspace/uaa-deployment folders respectively.

BYO UAA

If you are not using one of these two u up tools for deploying your UAA, and do not have the u env helper to setup environment variables, then you will need to manually setup the following env vars:

  • $UAA_URL - the URL for your UAA, such as https://login.mycompany.com
  • $UA_CA_CERT - [optional] the custom root CA for your UAA URL
  • $UA_CA_CERT_FILE - [optional] the custom root CA for your UAA URL stored in a local file

You also need to install the uaa CLI.

Wherever the instructions say u auth-client you will need to manually run the following commands to target and authenticate:

uaa target https://login.mycompany.com
uaa get-client-credentials-token uaa_admin --client_secret uaa_admin_secret

In the example above, the uaa_admin client should be replaced with an existing UAA client that has the uaa.admin authority to allow you to create new clients, users, groups, etc.

Dependencies on pull requests

These various applications or tutorials require the following PRs to be merged and/or releases cut: