"Error while getting list of workloads: invalid or missing credentials" error received during kubectl vsphere login with the users defined within the TMC's Access Policy
search cancel

"Error while getting list of workloads: invalid or missing credentials" error received during kubectl vsphere login with the users defined within the TMC's Access Policy

book

Article ID: 439114

calendar_today

Updated On:

Products

VMware vSphere Kubernetes Service VMware vSphere ESXi

Issue/Introduction

  • When logging in to a VKS Guest cluster using kubectl vsphere login command with the users defined within the TMC's Access Policy, following error is observed:
    Error while getting list of workloads: invalid or missing credentials
  • When the same user is added directly under the Namespace's permissions on vCenter Server, the user is able to login.
  • The vCenter Server and the TMC Self-Managed are connected to the same Active Directory where the user's credentials are stored.
  • Search path configured on the vCenter Server's Identity Source is different from where the user is actually stored on the Active Directory.
    For example, base distinguished name for users on vCenter Server is configured as: cn=Users,dc=<domain_name>,dc=com.
    Whereas, the user is actually stored in a different custom path, like: OU=Users,dc=<domain_name>,dc=com

Environment

  • Tanzu Mission Control
  • VMware vCenter Server

Cause

This issue occurs due to a configuration discrepancy between where user accounts are physically located within the Active Directory hierarchy and how the identity source's search boundaries are configured in vCenter Single Sign-On (SSO)

Resolution

Active Directory search scope within vCenter Server's identity source needs to be broadened to include the custom Organization Units.

Follow the below steps:

  1. Log in to the vCenter Server as local administrator user, i.e. 'administrator@<local_SSO>'.
  2. Navigate to Administration > Single Sign-On > Configuration > Identity Provider.
  3. Select the affected Active Directory Identity Source and click Edit.
  4. Update the search paths within Base distinguished name for users field to include the custom OUs, wherein either the target user's path can be configured or path to the root domain can be mentioned which shall instruct the vCenter Server to search the entire Active Directory tree:
    1. Example: OU=Users,DC=<domain_name>,DC=com
    2. Example: DC=<domain_name>,DC=com
  5. Similarly, enter the corresponding path into the Base distinguished name for groups field.
  6. Click Save
  7. Refer: Add or Edit a vCenter Single Sign-On Identity Source.

Once the Identity Source configuration is saved, attempt to re-login to the Guest Cluster(s) with the kubectl vsphere login utility.