A SAML Proxy Identity Zone in UAA acts as a logical tenant that proxies authentication requests to an external SAML Identity Provider (IdP) for single sign-on (SSO). Moving such a zone between UAA instances involves replicating its configuration, including SAML settings, from one UAA instance to another. Below, I’ll provide a clear, step-by-step guide to achieve this, based on Cloud Foundry UAA documentation and standard SAML practices, while addressing the provided web results where relevant.
Prerequisites
Log in to the Source UAA Instance:
uaac target <source-uaa-url>
uaac token client get <admin-client-id> -s <admin-client-secret>
Replace <source-uaa-url>, <admin-client-id> , and <admin-client-secret> with the source UAA’s endpoint and admin credentials.
uaac context
Export the Identity Zone Configuration:
uaac curl /identity-zones
Note the id or subdomain of the zone you want to move (e.g., zone-id or myzone.example.com).
uaac curl/identity-zones/<zone-id> > zone-config.json
This JSON file includes the zone's SAML configuration (e.g., samlConfig , idpMetadata , entityID , etc.).
Prepare the SAML IdP Metadata:
curl <metadataURL> -o idp-metadata.xml
Verify the metadata includes the IdP's entityID , SingleSignOnService URL, and signing certificate. Ensure the target UAA can access this URL or use the statis XML file.
Set Up the Target UAA Instance:
uaac target <target-uaa-url>
uaac token client get <admin-client-id> -s <admin-client-secret>
Create the Identity Zone in the Target UAA:
openssl genrsa -out privatekey.pem 2048
openssl req -new -x509 -key privatekey.pem -out certificate.pem -days 365
uaac curl -X POST /identity-zones -H "content-Type: applicaiton/json" -d @zone-config.json
This creates the zone with the SAML Proxy configuration.
Configure the SAML IdP for the Target UAA:
uaac curl /saml/metadata -o sp-metadata.xml
Or access it via the browser at http://<target-uaa-url>/saml/metadata .
Ensure the IdP sends the correct NameID format (e.g., urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress) and any required attributes (e.g., email, group).
Migrate Users and Groups (Optional):
uaac user > user.json
uaac groups > groups.json
uaac user add <username> -p <password> --email <email>
uaac group add <group-name>
uaac member add <group-name> <username>
If using Just-In-Time (JIT) provisioning, the SAML IdP can create users dynamically on first login, provided enableJITProvisioning is enabled in the zone’s samlConfig.
Test the SAML Configuration:
uaac target <target-uaa-url>/<zone-subdomain>
uaac token sso get <client-id> -s <client-secret>
uaac curl /var/log/uaa.log
Update DNS and Clients:
Decommission the Source Zone (Optional):
uaac curl -X DELETE /identity-zones/<zone-id>