{"id":3990,"date":"2023-11-29T09:53:41","date_gmt":"2023-11-29T09:53:41","guid":{"rendered":"https:\/\/geekmungus.co.uk\/?p=3990"},"modified":"2023-11-29T09:53:41","modified_gmt":"2023-11-29T09:53:41","slug":"vmware-vcenter-sso-authentication-via-okta-with-scim-user-provisioning-locally-driven","status":"publish","type":"post","link":"https:\/\/geekmungus.co.uk\/?p=3990","title":{"rendered":"VMware vCenter SSO Authentication via OKTA (with SCIM User Provisioning &#8211; Locally Driven)"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">VMware vCenter can use a multitude of authentication methods, such as LDAP, Active Directory and SAML (ADFS), however since vCenter 8.0 U1 the ability to integrate with OKTA for authentication has been added, which allows for adding MFA (multi-factor authentication) for enhanced security and detaching the vCenter appliance from Active Directory.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">When switching to use OKTA based authentication there is then a need to manage the SSO User and Group accounts, something that was previously not necessary when vCenter was joined to Active Directory. vCenter offers SCIM User Provisioning support to allow the creation, update and removal of user and group accounts within vCenter via a RESTful API. You can find guides on this in the &#8220;Additional Information&#8221; section at the bottom of the page.<\/p>\n\n\n\n<p class=\"has-black-color has-light-green-cyan-background-color has-text-color has-background has-link-color wp-elements-1 wp-block-paragraph\">At the time of writing SCIM User Provisioning requires OKTA to be able to talk directly to the API on your vCenter to SCIM provision users, now this is a non-starter security wise, as we are not exposing vCenter directly to the Internet. However, with the correct runes you can administer user and group accounts via the API with SCIM directly from within the network rather than OKTA provisioning and administering accounts.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The documentation has been based on:\u00a0<a href=\"https:\/\/iamse.blog\/2023\/04\/25\/enable-okta-for-vmware-vcenter-server\/\">Enable Okta for VMware vCenter Server<\/a>.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"VMwarevCenterSSOAuthenticationviaOKTA(withSCIMUserProvisioningLocallyDriven)-Operational\">Operational<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">To operationally manage&nbsp;<strong>SSO Users<\/strong>&nbsp;and&nbsp;<strong>Groups&nbsp;<\/strong>within vCenter using the REST API with SCIM, you can find the following guide within this section. These assume that you have already configured the link between vCenter and OKTA for user authentication, for instructions on this see section: &#8220;Implementation and Configuration&#8221;.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The VMware SCIM Guide:&nbsp;<a href=\"https:\/\/github.com\/vmware\/idm\/wiki\/SCIM-guide\">https:\/\/github.com\/vmware\/idm\/wiki\/SCIM-guide<\/a>, although written for VMware IDM can be used for VMware vCenter assuming the URLs are amended as described below.&nbsp;<\/p>\n\n\n\n<p class=\"has-light-green-cyan-background-color has-background wp-block-paragraph\">There are additional fields (attributes) that may be added to a user or group either during or post creation, see the SCIM Guide above for more details.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">ExternalID and Why it is Important<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">During the configuration we came across the ExternalID field, this is essential to allowing the OKTA OIDC authentication to work, you can find in the section below entitled: &#8220;User Fetching Exception &#8211; User Not Found&#8221; a more complete explaination, but the take home is that you need to ensure that you know the value of the NameID attribute in OKTA for each user, because this is mapped to the ExternalID for the corresponding account within vCenter and is used by vCenter when matching the OIDC authentication request when it is passed via the client from OKTA.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em><strong>i.e. OKTA NameId \u2192 vCenter ExternalId<\/strong><\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Finding what this NameId is for each user is out of the scope of this document, but it can be found by examining the logs of failed logon attempts or better still by querying the OKTA API directly to determine it. Note that the NameID value may not be the same for a particular user across all applications.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Bearer Token<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Using CURL it is helpful to put the Bearer Token into a variable so it&#8217;s easier to use.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>export VCENTER_BEARER=&lt;Bearer Token String><\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"VMwarevCenterSSOAuthenticationviaOKTA(withSCIMUserProvisioningLocallyDriven)-ListUsers\">List Users<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">To list the users currently in vCenter as SSO users you can run the following, and optionally output via &#8220;json_pp&#8221; to give you a more pretty output!<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>curl -v -k https:\/\/&lt;vCenter FQDN>\/usergroup\/t\/CUSTOMER\/scim\/v2\/Users -H \"Authorization: Bearer $VCENTER_BEARER\"<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"VMwarevCenterSSOAuthenticationviaOKTA(withSCIMUserProvisioningLocallyDriven)-ListGroups\">List Groups<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">To list the groups currently in vCenter as SSO groups, you can run the following and optionally output via &#8220;json_pp&#8221; to give you a more pretty output!<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>curl -v -k https:\/\/&lt;vCenter FQDN>\/usergroup\/t\/CUSTOMER\/scim\/v2\/Groups -H \"Authorization: Bearer $VCENTER_BEARER\"<\/code><\/pre>\n\n\n\n<p class=\"has-pale-cyan-blue-background-color has-background wp-block-paragraph\">The SSO Groups are not visible (at the time of writing) in the VMware vCenter GUI, you can only see these via the REST API (using the query above), or when selecting the SSO group for use in assigning its membership of a vCenter group.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"VMwarevCenterSSOAuthenticationviaOKTA(withSCIMUserProvisioningLocallyDriven)-CreateUser\">Create User<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">To create a user, first populate the contents of the JSON file &#8220;create_scim_user.json with the details for that particular user, you need the externalId for that application from OKTA, it is essential this value is created and match the value that is supplied by OKTA during logon, if you do not have this value populated vCenter cannot match the incoming authentication attempt with the account that SCIM has created.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>curl -v -k https:\/\/&lt;vCenter FQDN>\/usergroup\/t\/CUSTOMER\/scim\/v2\/Users -d @create_scim_user.json -H \"Authorization: Bearer $VCENTER_BEARER\" -H \"Content-Type: application\/scim+json\"<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">For example populate the required fields in the file:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>emails:value<\/li>\n\n\n\n<li>familyName<\/li>\n\n\n\n<li>givenName<\/li>\n\n\n\n<li>userName<\/li>\n\n\n\n<li>externalId<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">The &#8220;externalId&#8221; can be found from OKTA, although vCenter will generate an &#8220;Id&#8221;, this is different from the account&#8217;s &#8220;externalId&#8221;.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>create_scim_user.json<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\r\n    \"emails\": &#91;\r\n        {\r\n            \"value\": \"bob.smith@domain.com\"\r\n        }\r\n    ],\r\n    \"name\": {\r\n        \"familyName\": \"Smith\",\r\n        \"givenName\": \"Bob\"\r\n    },\r\n    \"schemas\": &#91;\r\n        \"urn:ietf:params:scim:schemas:core:2.0:User\",\r\n        \"urn:ietf:params:scim:schemas:extension:ws1b:2.0:User\"\r\n    ],\r\n    \"userName\": \"bob.smith\",\r\n    \"externalId\": \"00u17ayjOil3jVOq9416\"\r\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"VMwarevCenterSSOAuthenticationviaOKTA(withSCIMUserProvisioningLocallyDriven)-CreateGroup\">Create Group<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">To create a group,&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>curl -v -k https:\/\/&lt;vCenter FQDN>\/usergroup\/t\/CUSTOMER\/scim\/v2\/Groups -d @create_scim_group.json -H \"Authorization: Bearer $VCENTER_BEARER\" -H \"Content-Type: application\/scim+json\"<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">For example populate the required fields in the file:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>displayName<\/li>\n<\/ol>\n\n\n\n<p class=\"has-pale-cyan-blue-background-color has-background wp-block-paragraph\">You cannot add users to a group at the point of creation, you must first add the group, then assign users to the group.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">create_scim_group.json<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\r\n    \"displayName\": \"vCenterAdmins\",\r\n    \"schemas\": &#91;\r\n        \"urn:scim:schemas:core:1.0\"\r\n    ]\r\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"VMwarevCenterSSOAuthenticationviaOKTA(withSCIMUserProvisioningLocallyDriven)-AddSSOGrouptovCenterGroup\">Add SSO Group to vCenter Group<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">You only need to do this action once per group, i.e. once you have a SSO group, to ensure it has vCenter permissions you need to add it to a vCenter Group of which you can assign permissions to actually allow you to take actions. In this example we are creating an SSO Group called &#8220;vCenterAdmins&#8221; then adding it to the vCenter Group: &#8220;Administrators&#8221;.\u00a0<\/p>\n\n\n\n<p class=\"has-light-green-cyan-background-color has-background wp-block-paragraph\">Adding the SSO Group to the vCenter group, then adding SSO Users to the SSO Group which then gives them vCenter Group permissions is (at the time of writing) the only way to achieve assigning permissions to an SSO User via SCIM. I.e. you can&#8217;t directly add a SSO User to a vCenter group via SCIM, so you need to add the SSO User to a SSO Group, and that SSO Group needs to be a member of the vCenter group (with the correct permissions). Doing this avoids you having to perform a manual step via the GUI to assign a SSO User to a vCenter group.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"504\" src=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2023\/11\/image-1-1024x504.png\" alt=\"\" class=\"wp-image-3992\" srcset=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2023\/11\/image-1-1024x504.png 1024w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2023\/11\/image-1-300x148.png 300w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2023\/11\/image-1-768x378.png 768w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2023\/11\/image-1.png 1401w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Add the SSO Group &#8220;vCenterAdmins&#8221; to your vCenter Group.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"797\" height=\"541\" src=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2023\/11\/image-2.png\" alt=\"\" class=\"wp-image-3993\" srcset=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2023\/11\/image-2.png 797w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2023\/11\/image-2-300x204.png 300w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2023\/11\/image-2-768x521.png 768w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2023\/11\/image-2-305x207.png 305w\" sizes=\"auto, (max-width: 797px) 100vw, 797px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"VMwarevCenterSSOAuthenticationviaOKTA(withSCIMUserProvisioningLocallyDriven)-AddGroupMembers\">Add Group Members<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">To add a member to the group, you first need the following bits of information<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Group&#8217;s ID<\/li>\n\n\n\n<li>User&#8217;s ID<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">You&#8217;ll need the group &#8220;Id&#8221; in the URL and the user &#8220;Id&#8221; in the JSON file.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>curl -v -k -X PATCH https:\/\/&lt;vCenter FQDN>\/usergroup\/t\/CUSTOMER\/scim\/v2\/Groups\/&lt;Group ID> -d @vCenterAdmin-update_scim_group.json -H \"Authorization: Bearer $VCENTER_BEARER\" -H \"Content-Type: application\/scim+json\"<\/code><\/pre>\n\n\n\n<p class=\"has-pale-cyan-blue-background-color has-background wp-block-paragraph\">You may need to use the &#8220;json-patch+json&#8221; content type.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example populate the required fields in the file:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>value<\/strong>&nbsp;(must contain the ID of the user who you wish to add into the group.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">It should be possible to add multiple members at one time, but this was not tested.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>vCenterAdmin-update_scim_group.json<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\r\n    \"schemas\": &#91;\"urn:ietf:params:scim:api:messages:2.0:PatchOp\"],\r\n    \"Operations\":&#91;\r\n        {\r\n            \"op\":\"add\",\r\n            \"path\": \"members\",\r\n            \"value\": &#91;\r\n                {\r\n                    \"value\": \"29f7bac3-379e-4608-9098-86ba2fc633ee\"\r\n                }\r\n            ]\r\n        }\r\n    ]\r\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"VMwarevCenterSSOAuthenticationviaOKTA(withSCIMUserProvisioningLocallyDriven)-ListGroupMembers\">List Group Members<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">You need to find the Group&#8217;s ID, so you can enter it to see the members of just that group.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>curl -v -k https:\/\/&lt;vCenter FQDN>\/usergroup\/t\/CUSTOMER\/scim\/v2\/Groups\/&lt;Group ID> -H \"Authorization: Bearer $VCENTER_BEARER\"<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"VMwarevCenterSSOAuthenticationviaOKTA(withSCIMUserProvisioningLocallyDriven)-RemoveGroupMembers\">Remove Group Members<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">To remove a user from a group, you need to PATCH including the Group ID and then the following JSON file.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>curl -v -k -X PATCH https:\/\/&lt;vCenter FQDN>\/usergroup\/t\/CUSTOMER\/scim\/v2\/Groups\/&lt;Group ID> -d @vCenterAdmin-delete_scim_group_member.json -H \"Authorization: Bearer $VCENTER_BEARER\" -H \"Content-Type: application\/scim+json\"\r<\/code><\/pre>\n\n\n\n<p class=\"has-pale-cyan-blue-background-color has-background wp-block-paragraph\">You may need to use the &#8220;json-patch+json&#8221; content type.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example populate the required fields in the file:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>value&nbsp;<\/strong>(must contain the ID of the user who you wish to add into the group)<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">Notice the &#8220;op&#8221; as &#8220;remove&#8221; to remove the member from the group, don&#8217;t use the DELETE method, otherwise you&#8217;ll delete the whole group!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>vCenterAdmin-delete_scim_group_member.json<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\r\n    \"schemas\": &#91;\"urn:ietf:params:scim:api:messages:2.0:PatchOp\"],\r\n    \"Operations\":&#91;\r\n        {\r\n            \"op\":\"remove\",\r\n            \"path\": \"members\",\r\n            \"value\": &#91;\r\n                {\r\n                    \"value\": \"29f7bac3-379e-4608-9098-86ba2fc633ee\"\r\n                }\r\n            ]\r\n        }\r\n    ]\r\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"VMwarevCenterSSOAuthenticationviaOKTA(withSCIMUserProvisioningLocallyDriven)-DeleteGroup\">Delete Group<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">To remove a group, you can run the following, you require the Group ID (id) to be specified, you can find this ID by listing the groups.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>curl -v -k -X DELETE https:\/\/&lt;vCenter FQDN>\/usergroup\/t\/CUSTOMER\/scim\/v2\/Groups\/&lt;Group ID> -H \"Authorization: Bearer $VCENTER_BEARER\"<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"VMwarevCenterSSOAuthenticationviaOKTA(withSCIMUserProvisioningLocallyDriven)-DeleteUser\">Delete User<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">To delete a user, you can run the following, like removing a group you only need to provide the User&#8217;s ID (id), which you can find by listing all the user accounts. Note you do not need to remove the user account from any groups first.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>curl -v -k -X DELETE https:\/\/&lt;vCenter FQDN>\/usergroup\/t\/CUSTOMER\/scim\/v2\/Users\/&lt;User ID> -H \"Authorization: Bearer $VCENTER_BEARER\"<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"VMwarevCenterSSOAuthenticationviaOKTA(withSCIMUserProvisioningLocallyDriven)-Regenerate\/RotateUserProvisioningToken\">Regenerate\/Rotate User Provisioning Token<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The User Provisioning Token which is used by SCIM User provisioning requires a manual regeneration and rotate periodically, to do this access the folllowing menu and regenerate the token, then update the token in any locations where it is used.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Administration \u2192 Single Sign On \u2192 Configuration \u2192 Identity Provider<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"391\" src=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2023\/11\/image-3-1024x391.png\" alt=\"\" class=\"wp-image-3994\" srcset=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2023\/11\/image-3-1024x391.png 1024w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2023\/11\/image-3-300x115.png 300w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2023\/11\/image-3-768x293.png 768w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2023\/11\/image-3-1536x587.png 1536w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2023\/11\/image-3.png 1712w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"VMwarevCenterSSOAuthenticationviaOKTA(withSCIMUserProvisioningLocallyDriven)-ImplementationandConfiguration\">Implementation and Configuration<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">The configuration of vCenter to use OpenID Connect (OIDC) with SAML can be found at:\u00a0<a href=\"https:\/\/iamse.blog\/2023\/04\/25\/enable-okta-for-vmware-vcenter-server\/\">Enable Okta for VMware vCenter Server<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">he configuration follows this procedure, however the following changes and ommissions were required for our environment:<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"VMwarevCenterSSOAuthenticationviaOKTA(withSCIMUserProvisioningLocallyDriven)-1.DomainName(s)\">1. Domain Name(s)<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The Active Directory domain needed to be entered as &#8220;internal.sanger.ac.uk&#8221; which is the SSO username.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"VMwarevCenterSSOAuthenticationviaOKTA(withSCIMUserProvisioningLocallyDriven)-2.OpenIDConnect-ConfigurationURL\">2. OpenID Connect &#8211; Configuration URL<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The Configuration URL provided in the documentation did not work in our environment this needed to be changed from: \u00a0<strong>https:\/\/yourdomain.okta.com\/oauth2\/default\/.well-known\/openid-configuration<\/strong>\u00a0to\u00a0<strong>https:\/\/yourdomain.okta.com\/.well-known\/openid-configuration<\/strong>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"VMwarevCenterSSOAuthenticationviaOKTA(withSCIMUserProvisioningLocallyDriven)-3.UserProvisioningTokenLifespan\">3. User Provisioning Token Lifespan<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">You may consider changing this to suit your environment, in our case we changed this to 12 Months to avoid the need to rotate the key within our provisioning script too frequently.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"VMwarevCenterSSOAuthenticationviaOKTA(withSCIMUserProvisioningLocallyDriven)-UserFetchingException-UserNotFound\">User Fetching Exception &#8211; User Not Found<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">During configuration, We were experiencing this issue: &#8220;<em>User fetching exception with nameId b1e5f84d-xxxx-xxxx-xxxx-a7bfecxxxxc4, nameIdFormat ExternalId, and domains [], user not found&#8221;<\/em>. although Spencer Shirley&#8217;s article:&nbsp;<a href=\"https:\/\/www.linkedin.com\/pulse\/vcenter-80u2-mfa-entra-id-spencer-shiley-ibi3c\">vCenter 8.0u2 MFA with Entra ID<\/a>&nbsp;is for EntraID is the cause was the same in our case, the&nbsp;<strong>externalId&nbsp;<\/strong>attribute was missing from our user account entry, the externalId should contain the value of the nameId from OKTA as vCenter uses this to match the incoming authentication request against the correct user in vCenter (created by SCIM).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you look in the following log file (and if required grep for the following field) you can see the logon failure error shown.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ cat \/var\/log\/vmware\/vc-ws1a-broker\/federation-service.log | grep \"User fetching\"<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">As you can see the is a &#8220;User fetching exception&#8221;, annoyingly you never see the username, because in this case it cannot match the user name against anything to know which one it is. But you can see the nameId value &#8220;00u173453jVOqyjO9416&#8221; of the user account, this is what needed to be populated in the externalId attribute of the user account.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>2023-11-24T18:56:04,052 WARN  vcenter.domain.com:federation (auth-common-forkjoin-pool1) &#91;CUSTOMER;-;10.100.100.101;460c0397-82bd-4539-95bb-067467d34794;-;9b12147f-9e0f-4af3-9b0f-b7c0e497fd01] com.vmware.vidm.federation.login.processor.AuthResponseUserResolver - User fetching exception with nameId 00u173453jVOqyjO9416, nameIdFormat ExternalId, and domains &#91;domain.com, internal.domain.com], user not found\r\n2023-11-24T18:56:33,442 WARN  vcenter.domain.com:federation (auth-common-forkjoin-pool1) &#91;CUSTOMER;-;10.100.100.101;4801ee5b-4e76-41dd-8428-eb809c196245;-;8412d468-f1dc-4071-b74f-d21c41786a85] com.vmware.vidm.federation.login.processor.AuthResponseUserResolver - User fetching exception with nameId 00u173453jVOqyjO9416, nameIdFormat ExternalId, and domains &#91;domain.com, internal.domain.com], user not found<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">A working logon looks like this for the username bob.smith.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>2023-11-29T09:47:48,393 INFO  vcenter.domain.com:federation (federation-business-pool-0) &#91;CUSTOMER;-;10.100.100.101;b389e70d-6731-4453-9893-24eddf1da545;-;c4dd46da-4d01-4866-850e-1f6785d54a92] com.vmware.vidm.federation.token.TokenPersistenceService - Generated token with Id 96d50afa-1234-43a8-9c20-1487e2437ede and calling rest endpoint to add to Token service\n2023-11-29T09:47:48,437 INFO \u00a0vcenter.domain.com:federation (federation-business-pool-1) &#91;CUSTOMER;-;10.100.100.101;b389e70d-6731-4453-9893-24eddf1da545;-;c4dd46da-4d01-4866-850e-1f6785d54a92] com.vmware.vidm.federation.login.LoginEventServiceAspect - Login successful for context: c4dd46da-1234-4866-850e-1f6785d54a92 and username: Optional&#91;bob.smith] domain: Optional&#91;Optional&#91;domain.com], resourceUuid: Optional.empty<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Login URL<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">To login you would use the URL <strong>https:\/\/&lt;vCenter FQDN>\/ui\/login<\/strong>, where you get a logon page that specifies the &#8220;Sign in with OKTA&#8221; button, if you need to login locally, i.e. not via OKTA but using the local or SSO account, you can click &#8220;Sign in with local account&#8221; at the bottom.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"752\" src=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2023\/11\/image-4-1024x752.png\" alt=\"\" class=\"wp-image-3996\" srcset=\"https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2023\/11\/image-4-1024x752.png 1024w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2023\/11\/image-4-300x220.png 300w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2023\/11\/image-4-768x564.png 768w, https:\/\/geekmungus.co.uk\/wp-content\/uploads\/2023\/11\/image-4.png 1167w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h1 class=\"wp-block-heading\">Additional Information<\/h1>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a class=\"\" href=\"https:\/\/iamse.blog\/2023\/04\/25\/enable-okta-for-vmware-vcenter-server\/\">https:\/\/iamse.blog\/2023\/04\/25\/enable-okta-for-vmware-vcenter-server\/<\/a><\/li>\n\n\n\n<li><a class=\"\" href=\"https:\/\/www.linkedin.com\/pulse\/vcenter-80u2-mfa-entra-id-spencer-shiley-ibi3c\">https:\/\/www.linkedin.com\/pulse\/vcenter-80u2-mfa-entra-id-spencer-shiley-ibi3c<\/a><\/li>\n\n\n\n<li><a class=\"\" href=\"https:\/\/github.com\/vmware\/idm\/wiki\/SCIM-guide#add-a-user-to-a-group\">https:\/\/github.com\/vmware\/idm\/wiki\/SCIM-guide#add-a-user-to-a-group<\/a><\/li>\n\n\n\n<li><a class=\"\" href=\"https:\/\/help.zscaler.com\/zia\/scim-api-examples\">https:\/\/help.zscaler.com\/zia\/scim-api-examples<\/a><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/unsplash.com\/@kellysikkema\">Image Attribution<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>VMware vCenter can use a multitude of authentication methods, such as LDAP, Active Directory and SAML (ADFS), however since vCenter 8.0 U1 the ability to integrate with OKTA for authentication has been added, which allows for adding MFA (multi-factor authentication) for enhanced security and detaching the vCenter appliance from Active Directory. When switching to use &#8230; <a title=\"VMware vCenter SSO Authentication via OKTA (with SCIM User Provisioning &#8211; Locally Driven)\" class=\"read-more\" href=\"https:\/\/geekmungus.co.uk\/?p=3990\" aria-label=\"Read more about VMware vCenter SSO Authentication via OKTA (with SCIM User Provisioning &#8211; Locally Driven)\">Read more<\/a><\/p>\n","protected":false},"author":4,"featured_media":3999,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22,25],"tags":[],"class_list":["post-3990","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-security","category-vmware"],"_links":{"self":[{"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/3990","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3990"}],"version-history":[{"count":5,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/3990\/revisions"}],"predecessor-version":[{"id":4000,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/3990\/revisions\/4000"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/media\/3999"}],"wp:attachment":[{"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3990"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3990"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3990"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}