When attempting to onboard a Connected Cluster or create an Organization Group within the Tanzu Platform Appliance Hub instance, the process fails with the following error:
Create Org Group failed: Failed to perform token exchange: Response code 401 (Unauthorized)
This typically occurs in environments utilizing an internal user store (UAA) rather than an external Identity Provider (IDP).
Tanzu Hub requires the administrative user initiating the onboarding (commonly tanzu_platform_admin) to exist in the target foundation's internal user store (EAR UAA) to facilitate token exchange and role synchronization. If the user exists in the Hub UAA but is missing from the foundation's UAA, the foundation will reject the request with a 401 Unauthorized error.
The administrative user must be manually created and granted the necessary scopes in the target foundation's UAA.
Log in to the foundation via CF CLI: Ensure you are targeting the foundation where the cluster onboarding is failing.
Create the administrative user: Run the following command to create the user in the foundation: cf create-user tanzu_platform_admin
Grant UAA administrative scopes: Use the uaac tool to grant the necessary permissions for token exchange and role synchronization:
uaac target <UAA_ENDPOINT>uaac token client get admin -s <ADMIN_CLIENT_SECRET>uaac member add cloud_controller.admin tanzu_platform_adminuaac member add uaa.admin tanzu_platform_adminuaac member add scim.read tanzu_platform_adminuaac member add scim.write tanzu_platform_adminVerify User Email: Ensure the email address for tanzu_platform_admin in the foundation's UAA matches the one used in Tanzu Hub (typically [email protected]).
Retry Onboarding: Navigate back to the Tanzu Hub UI and retry the cluster onboarding or organization group creation.