[400] Unable to authenticate. Check your credentials. If problem persists, contact your administrator.
"oauth2.authorization.credentials.invalid"/var/log/vmware/vsphere-ui/logs/vsphere_client_virgo.log
YYYY-MM-DDTHH:MIN:SEC [ERROR] p-nio-127.0.0.1-5090-exec-12 70000572 100326 ###### com.vmware.skyscraper.oauth2.common.Oauth2Helper Exception while exchanging token with csp with for code ###### and state ##-##-##-####. Csp responded with status 401 UNAUTHORIZED and body "error":"invalid_client","error_description":"oauth2.authorization.credentials.invalid"}YYYY-MM-DDTHH:MIN:SEC [ERROR] p-nio-127.0.0.1-5090-exec-12 70000572 100326 ###### c.v.vsphere.client.security.oauth2.Oauth2CodeResponseHandler Oauth2 Authorization code assertion failed java.lang.RuntimeException: Generating Authorization Token has an exception at com.vmware.skyscraper.oauth2.common.Oauth2Helper.handleAuthTokenRequest(Oauth2Helper.java:201) at com.vmware.skyscraper.oauth2.common.Oauth2Helper.handleAuthTokenRequest(Oauth2Helper.java:117)
credentials.invalid"/var/log/vmware/vc-ws1a-broker/accesscontrol-service.log
YYYY-MM-DDTHH:MIN:SEC WARN example.vcenter.local:accesscontrol (ForkJoinPool-5-worker-4) [CUSTOMER;-;127.0.0.1;####-##-####; ####-##-####;authorization_code] com.vmware.vidm.accesscontrol.OAuth2ClientService - [getValidatedClient] Unable to verify client secret.YYYY-MM-DDTHH:MIN:SEC WARN example.vcenter.local:accesscontrol (ForkJoinPool-5-worker-4) [CUSTOMER;-;127.0.0.1;##-##-##; ##-##-##;authorization_code] com.vmware.vidm.accesscontrol.resource.auth.TokenResource - Failed during issuing token java.util.concurrent.CompletionException: java.util.concurrent.CompletionException: com.vmware.vidm.accesscontrol.exceptions.oauth2.UnauthorizedClientException: oauth2.authorization.credentials.invalid at com.vmware.vidm.accesscontrol.resource.auth.TokenResource.lambda$getToken$3(TokenResource.java:351) at java.base/java.util.concurrent.CompletableFuture.uniExceptionally(Unknown Source) at java.base/java.util.concurrent.CompletableFuture$UniExceptionally.tryFire(Unknown Source) at java.base/java.util.concurrent.CompletableFuture.postComplete(Unknown Source) at java.base/java.util.concurrent.CompletableFuture.postFire(Unknown Source) at java.base/java.util.concurrent.CompletableFuture$UniCompose.tryFire(Unknown Source) at java.base/java.util.concurrent.CompletableFuture$Completion.run(Unknown Source)
Failed to update client secret"/var/log/vmware/trustmanagement/trustmanagement-svcs.log
YYYY-MM-DDTHH:MIN:SEC [pool-12-thread-1 [] ERROR com.vmware.iam.txaz.secretrotation.ClientSecretRotator opId=] Rotation the secret of client ####-##-##failedcom.vmware.iam.txaz.exception.TxazException: Failed to update client secret in TMS for Identity Provider: CUSTOMER at com.vmware.vcenter.trustmanagement.authbroker.SsoOAuthAppSecretExpiryChecker$VcClientCredentialProvider.setClientSecret(SsoOAuthAppSecretExpiryChecker.java:188) ~[libservice.jar:?] at com.vmware.iam.txaz.secretrotation.ClientSecretRotator.rotateSecret(ClientSecretRotator.java:118) ~[vc-txaz-client.jar:?] at com.vmware.iam.txaz.secretrotation.ClientSecretRotator.lambda$initSecretRotationTask$0(ClientSecretRotator.java:71) ~[vc-txaz-client.jar:?] at com.vmware.iam.txaz.secretrotation.ClientSecretRotator.lambda$errorHandlingWrapper$1(ClientSecretRotator.java:85) ~[vc-txaz-client.jar:?]Caused by: com.vmware.vcenter.trustmanagement.impl.VCFBrokerRestrictionException: VC restricts update/create API call for VMWARE_SSO_FEDERATION, Please delete the IDP and create another one at com.vmware.vcenter.trustmanagement.impl.VcIdentityProviders.update(VcIdentityProviders.java:389) ~[libservice.jar:?] at com.vmware.vcenter.trustmanagement.impl.VcIdentityProviders.update(VcIdentityProviders.java:369) ~[libservice.jar:?]
This issue is resolved in vCenter 9.0.2. Log in to the Broadcom Support Portal to download this patch, depending on your entitlement, VMware vSphere Foundation or VMware Cloud Foundation.
Note: If you are experiencing this issue on 9.0.0 or 9.0.1, apply the workaround below to resolve the issue. Afterward, upgrade vCenter to 9.0.2 to prevent the issue from recurring.
Recreate the IDP configuration for VC or update VC's IDP configuration with the new client secret.
Mandatory Steps
For the workload domain VCs, follow below mentioned steps from the UI to re-register the SSO configuration.
For the management domain VCs, there is no way to recreate the authsource from UI, so this has to be done manually by following either of the below mentioned methods.
Login to vCenter as 'root' user via SSH, then follow steps below:
curl -k --request POST --url https://<MGMT VC FQDN>/rest/com/vmware/cis/session -u '<Username>:<password>'curl -k --location --request GET 'https://<MGMT VC FQDN>/api/vcenter/identity/broker/tenants/CUSTOMER/admin-client' --header 'vmware-api-session-id: <session from step 1>' | jqcurl -k --request POST \ --url https://<MGMT VC FQDN>/acs/t/CUSTOMER/broker/oauth2-clients \ --header 'authorization: Bearer <tenant admin client token from step 2>' \ --header 'content-type: application/vnd.vmware.horizon.manager.accesscontrol.broker.oauth2client.with.rule.sets+json' \ --data '{ "access_token_ttl": 30, "client_id": "4######a-####-####-####-9#########21", "secret":"0######b-####-####-####-7#########27", "grant_types": [ "authorization_code", "client_credentials", "refresh_token", "password" ], "refresh_token_idle_ttl": 1440, "refresh_token_ttl": 1440, "rotate_secret": true, "redirect_uris": [ "https://<MGMT VC FQDN>/ui/login/oauth2/authcode" ], "rule_set_names": [ "READ_ONLY_TENANT_ADMIN" ], "scope": [ "admin", "user", "openid", "profile", "group" ]}'curl -k --request GET \ --url https://<MGMT VC FQDN>/api/vcenter/identity/providers/CUSTOMER \ --header 'content-type: application/json' \ --header 'vmware-api-session-id: <session from step 1>'curl -k --request DELETE \ --url https://<MGMT VC FQDN>/rest/vcenter/identity/providers/CUSTOMER \ --header 'content-type: application/json' \ --header 'vmware-api-session-id: <session from step 1>'curl -k --request POST \ --url https://<MGMT VC FQDN>/api/vcenter/identity/providers \ --header 'content-type: application/json' \ --header 'vmware-api-session-id: <session ID from step 1' \ --data '{ "federation_type": "VMWARE_SSO_FEDERATION", "provider": "CUSTOMER", "name": "VCF SSO", "config_tag": "Oidc", "is_default": true, "oidc": { "discovery_endpoint": "https://<MGMT VC FQDN>:443/acs/t/CUSTOMER/.well-known/openid-configuration", "client_id": "4######a-####-####-####-9#########21", "client_secret": "0######b-####-####-####-7#########27", "claim_map": {} }, "idm_protocol": "SCIM2_0", "idm_endpoints": [ "https://<MGMT VC FQDN>/usergroup/t/CUSTOMER/scim/v2/Groups", "https://<MGMT VC FQDN>/usergroup/t/CUSTOMER/scim/v2/Users" ], "auth_query_params": { "response_type": [ "code" ] }, "upn_claim": "acct", "groups_claim": "group_names", "domain_names": ["<domains from the existing provider here, which noted down in step 4>"]}'trustmanagement-vlsi.xml) to remove the ssoAppSecretExpiryChecker scheduled task to avoid the same issue in future. Execute the 'sed' command mentioned below:sed -i.bak \-e '/<bean id="ssoAppSecretExpiryChecker"/,/<\/bean>/d' \-e '/<task:scheduler id="ssoAppSecretExpiryCheckerScheduler"\/>/d' \-e '//d' \-e '/ <!-- Check for SSO OAuth App Client Secret Expiry in VIDB by instantiating TxazClient -->/d' \-e '/<task:scheduled-tasks scheduler="ssoAppSecretExpiryCheckerScheduler"/,/<\/task:scheduled-tasks>/d' \/usr/lib/vmware-trustmanagement/config/trustmanagement-vlsi.xmlservice-control --restart vmware-trustmanagementLogin to vCenter as 'root' user via SSH, then follow steps below:
Get VC Session
curl -k --request POST --url https://<MGMT VC FQDN>/rest/com/vmware/cis/session -u '<Username>:<password>'
curl -k --location --request GET 'https://<MGMT VC FQDN>/api/vcenter/identity/broker/tenants/CUSTOMER/admin-client' --header 'vmware-api-session-id: <session id from step 1>' | jq
curl -k --request GET \ --url https://<MGMT VC FQDN>/api/vcenter/identity/providers/CUSTOMER \ --header 'content-type: application/json' \ --header 'vmware-api-session-id: <session from step 1>'
curl -k --request POST \ --url 'https://<MGMT VC FQDN>/acs/t/CUSTOMER/broker/oauth2-clients/<CLIENT ID>?action=start-rotate-secret' \ --header 'accept: application/vnd.vmware.horizon.manager.accesscontrol.broker.oauth2client.secret.rotation+json' \ --header 'Content-Type: application/vnd.vmware.horizon.manager.accesscontrol.broker.oauth2client.secret.rotation+json' \ --header 'authorization: Bearer <tenant admin client token here from step 2>' \ --data '{ "primary_secret_auto_retire_duration": 1, "secondary_secret": "<new random secret>"}'curl -v -k --request POST \ --url 'https://<MGMT VC FQDN>/acs/t/CUSTOMER/broker/oauth2-clients/<CLIENT ID>?action=retire-primary-secret' \ --header 'accept: application/vnd.vmware.horizon.manager.accesscontrol.broker.oauth2client.secret.rotation+json' \ --header 'Content-Type: application/vnd.vmware.horizon.manager.accesscontrol.broker.oauth2client.secret.rotation+json' \ --header 'authorization: Bearer <tenant admin client token from step 2 >' \ --data '{}'curl -k --request PATCH \ --url https://<MGMT VC FQDN>/api/vcenter/identity/providers/CUSTOMER \ --header 'content-type: application/json' \ --header 'vmware-api-session-id: <session from step 1>' \ --data '{ "config_tag": "Oidc", "federation_type": "VMWARE_SSO_FEDERATION", "oidc": { "client_secret": "<secret id from step 4>" }}'
trustmanagement-vlsi.xml) to remove the ssoAppSecretExpiryChecker scheduled task to avoid the same issue in future. Execute the 'sed' command mentioned below:sed -i.bak \-e '/<bean id="ssoAppSecretExpiryChecker"/,/<\/bean>/d' \-e '/<task:scheduler id="ssoAppSecretExpiryCheckerScheduler"\/>/d' \-e '//d' \-e '/ <!-- Check for SSO OAuth App Client Secret Expiry in VIDB by instantiating TxazClient -->/d' \-e '/<task:scheduled-tasks scheduler="ssoAppSecretExpiryCheckerScheduler"/,/<\/task:scheduled-tasks>/d' \/usr/lib/vmware-trustmanagement/config/trustmanagement-vlsi.xmlservice-control --restart vmware-trustmanagement