top of page

VMware vSphere 8.0 U2 and federated Authentications with Microsoft Entra ID

  • Foto van schrijver: Edwin de Bruin
    Edwin de Bruin
  • 30 dec 2023
  • 6 minuten om te lezen

Bijgewerkt op: 29 jun 2024

A new feature available since vSphere 8.0 U2 is federated authentication with Microsoft Entra ID (Azure Active Directory) and provision the users with SCIM. This is really nice since it is now possible to create Single Sign On, leverage Conditional Access policies and Multi Factor Authentication (MFA).

ree

In this blog I will explain step by step how to configure this and how to mitigate a in my opinion big fat no no required in the original documentation: Expose vCenter to the public....


Chapter 1 setup the federation

  1. Tab on the "bars" next to vSphere Client

  2. Click on Administration

ree

  1. Click on Configuration

  2. Click on Change Provider

  3. Click on Azure AD

ree

Click on "Run Prechecks"

ree

Mark the checkbox "I confirm that prerequisites are met and acknowledge all warnings.

ree

Enter a Directory name and the Domain Name (as used in Entra ID), hit the "+" button. Click on Next.

ree

Adjust or hit next in the following screen:


ree

  1. Type in a IDP name, I used "EntraID" but this is up to you.

  2. Copy the Redirect URI by clicking on the copy button, this is needed further on.

ree

Switch to your Microsoft Azure portal and open App registrations, click on "+ New registration".


ree

  1. Enter a Name

  2. Switch to "Web"

  3. Paste the redirect URI you copied earlier.

  4. Click register.

ree

Copy the Application (client) ID, click on the copy button.


ree

Switch back to vCenter and copy the ClientID in the "Client Identifier" field.


ree

Switch to the Azure Portal Again, click on "Certificates & secrets".


ree

Click on "New client secret".

ree

  1. Enter a Description

  2. Hit "add"

ree

Copy the " value" of the new secret by clicking on the copy button


ree

Switch back to vCenter and paste the copied " value" in the " shared secret" field


ree

Switch back to Azure Portal

  1. Click on "Overview"

  2. Click on "Endpoints"

ree

Copy the value of the "OpenID Connect metadata document" by clicking the copy button.


ree

Switch back to vCenter and paste the value to the OpenID Address


ree

At the bottom click " Next"

ree

and the following screen click "Finish".

ree

You will see the following screen.


ree

Keep this screen open.


Chapter 2 setup the user provisioning.

In this chapter we are going to configure the user provisioning. There is no other way than provision the users by using SCIM from Entra ID to vCenter.


Switch to the Azure Portal again, open "Enterprise applications" and click on "+ New Application".


ree

This part is deviating from the VMware documentation. We are going to use the On-premises SCIM app. By using this we don't need to exposure the vCenter on the internet or setup tunnels but are going to use an on-premises agent. So instead selecting the "VMware Identity Service" search for the " On-premises SCIM app"


  1. type in "on premise".

  2. Select the "On-premises SCIM app".


ree
  1. Enter a name

  2. Click Create

ree

Click on "provisioning"

ree

Click on "provisioning" again.


ree

Switch "Provisioning mode to "Automatic".

ree

You can download the needed on-premises agent under "On-Premises Connectivity". Click on " download and install


ree

Click on "Accept terms & Download".

ree

Now I decided to install this agent on the same server running my Entra Connect. This is not a requirement; you can install this on any server you wish but this server must be able to reach vCenter.


Copy the downloaded agent to the server

ree

Double click on the installer, agree terms and click on "Install".

ree

Click next in the Welcome screen


ree

Select "on-premises application provisioning (Microsoft Entra ID to application).


ree

Connect to Microsoft Entra ID.

ree

Click Confirm


ree

When installed successfully click on " Close".


ree


A requirement is that the agent trusts the vCenter certificate. Connection will fail if the agent does not trust the certificate of the vCenter server. If you still use the default self-signed certificate as I do (I know, it's my HomeLab.) import the certificate of the vCenter to the "Trusted Root Certification Authorities" on the machine where you install the agent.


Back to the Azure Portal:


  1. Click on the "arrow" below "Agents".

  2. and select your newly installed agent.

ree

Click on Assign Agent.


ree

Now you can wait 10 minutes or restart the provisioning agent if your impatient (I am)


ree

Ok, so switch back to vCenter page. Copy the tenant URL below "User Provisioning" by clicking the copy button.


ree

In the Azure portal tab past this URL in the Tenant URL


ree

In the vCenter window generate a Secret Token by clicking the "Generate" button


ree

Copy the token by clicking the copy button.


ree

Paste this token in the Azure tab in the Secret Token field.


ree

the moment of truth... click "Test Connection".


ree

You are awesome, made sure the vCenter certificate is trusted, off course it works!


ree


Now hit Save


ree

Chapter 3 mapping the user attributes

Since we are provisioning Entra ID users to vCenter we need to map some of the Entra ID attributes to the attributes vCenter understands.


  1. Open Mappings

  2. Click on "Provision Azure Active Directory Users"

ree

Clean up the attributes so only the following attributes remain: UserName, active, name.givenName, name.FamilyName, externalid:

ree

Next,

  1. enable "Show advanced options".

  2. Click on "Edit attribute list for AgentBasedScim".

ree

Scroll to the last line and the following line as string:

urn:ietf:params:scim:schemas:extension:ws1b:2.0:User:domain 
ree

Hit Save

ree

Click on "mailnickname"


ree

  1. Change source attribute to "objectid"

  2. Match objects using this attribute to "Yes"

  3. click OK

ree

Click on "UserPrincipalName"

ree

We need to break up the UPN of the EntraID attribute and extract the username part.

  1. Change " Mapping type" to " Expression"

2. In the "Expression Field" type in the following value:

Item(Split([userPrincipalName], "@"), 1)

3. Change Match objects using this attribute to "No"

4. Click "Ok"

ree

Another change has to be made to the "externalid" attribute; we can do this now because we removed the "match objects using this attribute" in the previous step of the userName attribute.


Click on "objectid"


ree

  1. Mind the source attribute. Little bug, this might switch back to default. Make sure this is still "objectid"

  2. Change "matching precedence" to "1"

  3. click "OK".


Click on "add New Mapping:


ree

This time we need to extract the domain part of the UPN

  1. Change " Mapping type" to " Expression"

       2. In the "Expression Field" type in the following value:

Item(Split([userPrincipalName], "@"), 2)

       3. Change the target attribute to "urn:ietf:params:scim:schemas:extension:ws1b:2.0:User:domain

4. Click OK.


ree

The attributes Mappings should look like this now:


ree

2. Click Save


Next,

  1. Enable Provisioning Status

  2. Hit "Save"

ree
Chapter 4 Provision and Assign the users to the Apps

In the On-premises SCIM app

  1. Click on " Users and Groups"

  2. Click on " + Add user/group"

ree

  1. Click on "none selected" below "Users and groups".

  2. Search a user.

  3. Select the user.

  4. Click on "Select"

ree

Hit "Assign"

ree

We are going to test the provisioning now,

  1. Click "Provision on demand"

  2. Select the user you want to provision.

  3. Hit "Provision"

ree

And see the magic happen, the user is getting provisioned.


ree

In vCenter, when you go to "Users and Groups", select your Domain and voila the user is created!


ree

The user is there but has no actual rights in vCenter. let's assign this:

  1. Click on Global Permissions

  2. Click on Add

ree

assign the rights:

  1. Select your domain.

  2. Select the user.

  3. Select the Role.

  4. Propagate to children.

  5. Click OK.


ree

One last thing we need to do now in the Azure Portal; assign the user to the vCenter VCSA01 OPENID app:

  1. In the portal open Enterprise Applications and select the OpenID app

  2. Click on Users and groups.

  3. click on "+ Add user/group".


ree

Add the assignment:

  1. Click on "None Selected"

  2. Find the user.

  3. select the user.

  4. Click "Select"


Click on "Assign"


ree

Chapter 5 To the test track!

I suggest opening an "in private" window in your browser, enter your vCenter URL and hit the "Sign In" Button.


ree

You will be redirected to the Entra ID tenant


ree

Sign In with or without MFA accordingly to your Conditional access policies:


ree

Select the Consent and click "Accept".


ree

and you are in!


ree

Chapter 6 The Conclusions

  • This works really well! Now I can use Conditional access when accessing vCenter, for example force MFA with number matching.

  • I would not have implemented this if I needed to expose my vCenter publicly on the internet. For me that's a really big no no. The on prem SCIM agent is my opinion acceptable. This is only an outbound connection so no public exposure.

  • If you lock yourself out (happened to me... made a mistake in the attribute mapping and when getting a cup of coffee my vCenter session timed out...) you can still login by appending "/ui/?idp=local" to the vCenter url. This is the "breaking glass" url and you can login for example with your administrator@vsphere.local account.


Chapter 7 The Sources


When reading about the fact EntraID must be able to reach vCenter I started another search, there must be another way. I stumbled upon two links:


An article by Spencer Shiley struggling with the same opinion about exposing vCenter

vCenter 8.0u2 MFA with Entra ID (linkedin.com) This article shows really well the architecture and how this works and gave a big waysign in the right direction but missing some parts. I really suggest reading his article.


next stumbled upon a reddit post: SSO in vCenter and Azure AD without SCIM? : r/vmware (reddit.com). Especially the comment by "dstmar" filled a big gap.


Well, I hope this helps someone configuring this new great feature!


Any questions or remarks? Let me know!


Have a great 2024!

 
 
 
Post: Blog2_Post
bottom of page