Binding an Application to the UAA Instance

About this task

You must bind your application to your UAA instance to provision its connection details in the VCAP_SERVICES environment variable. The Cloud Foundry runtime uses the VCAP_SERVICES environment variable to communicate with a deployed application about its environment.

You can retrieve the following UAA instance details from the VCAP_SERVICES environment variable:

  • A dashboard_url for your instance. You can use this URL to access the dashboard for managing this instance of UAA.

  • A subdomain that specifies a sub-domain you can use in addition to the domain created for UAA.

  • A uaa_instance_uri for your instance.

  • A uaa_instance_issuerId for your instance. The issuerID is required when you create an instance of another service that uses your UAA instance for authentication.

  • A uaa_instance_GUID is the zoneID for your instance.

Procedure

  1. Use the Cloud Foundry CLI to log into Cloud Foundry.
    cf login -a <API_Endpoint>

    Depending on your Predix.io registration, the value of <API_Endpoint> is one of the following:

    • Predix US-West

      https://api.system.aws-usw02-pr.ice.predix.io

    • Predix US-East

      https://api.system.asv-pr.ice.predix.io

    • Predix Europe

      https://api.system.aws-eu-central-1-pr.ice.predix.io

    For example,

    cf login -a https://api.system.aws-usw02-pr.ice.predix.io
  2. Bind the application to the service instance by entering the following command:
    cf bind-service <your_app_name> <uaa_instance_name>

    The <uaa_instance_name> instance is bound to your application, and the following message is returned:

    Binding service <uaa_instance_name> to app <your_app_name> in org predix-platform / space predix as [email protected]...
    OK
    TIP: Use 'cf restage' to ensure your env variable changes take effect
    
  3. Verify the binding by entering the following command:
    cf env <your_app_name>
    Messages that are similar to the following messages are returned:
    Getting env variables for app myApp in org predix-platform / space security as [email protected]...
    OK
    ...
      ],
      "predix-uaa": [
            {
            "credentials":
            {
             "dashboardUrl": "https://uaa-dashboard.run.asv-pr.ice.predix.io/#/login/ff27c315-d027-4d1d-a30c-64f49b369ed9",
             "issuerId":
              "https://ff27c315-d027-4d1d-a30c-64f49b369ed9.predix-uaa.run.aws-usw02-pr.ice.predix.io/oauth/token",
             "subdomain": "ff27c315-d027-4d1d-a30c-64f49b369ed9",
             "uri": 
               "https://ff27c315-d027-4d1d-a30c-64f49b369ed9.predix-uaa.run.aws-usw02-pr.ice.predix.io",
              "zone": {
                        "http-header-name": "X-Identity-Zone-Id",
                        "http-header-value": "ff27c315-d027-4d1d-a30c-64f49b369ed9"
                       }
            },
            "label":
            "predix-uaa",
            "name":
            "my_uaa_instance",
            "plan":
            "free",
            "tags":
            []
            }
            ],

    In this sample, the following values are displayed:

    • dashboard_url = https://uaa-dashboard.run.asv-pr.ice.predix.io/#/login/ff27c315-d027-4d1d-a30c-64f49b369ed9
    • uaa_instance_issuerId = https://ff27c315-d027-4d1d-a30c-64f49b369ed9.predix-uaa.run.aws-usw02-pr.ice.predix.io/oauth/token
    • subdomain = 04187eb1-e0cf-4874-8218-9fb77a8b4ed9
    • uaa_instance_uri = https://ff27c315-d027-4d1d-a30c-64f49b369ed9.predix-uaa.run.aws-usw02-pr.ice.predix.io
    • uaa_instance_GUID = ff27c315-d027-4d1d-a30c-64f49b369ed9