Connect to an AD FS - Federated vCenter Server System
If your vCenter Server is federated to Active Directory Federation Services (AD FS), you can authenticate with PowerCLI by using the OAuth 2.0 Authorization Code grant type.
You can authenticate to a federated vCenter Server by creating a new OAuth security context and then exchanging it for a SAML security context. You create an OAuth security context for PowerCLI by using the New-OAuthSecurityContext cmdlet. One way to do this is to authenticate through the Authorization Code grant type, which is illustrated by this example. This workflow guarantees a substantial degree of security and can be used with multi-factor authentication.
Note: You can use PowerCLI to authenticate with the
other OAuth 2.0 grant types as well, such as the Client Credentials, Refresh Token,
and Password grant types. For more information, run
Get-Help
New-OAuthSecurityContext
-full
.Prerequisites
- Verify that your vCenter Server system is federted to AD FS. For more information, see Federate vCenter Server to Active Directory Federation Services (AD FS) in the VMware vCenter Server Management Programming Guide.
- Create an OAuth client for PowerCLI on the authentication server (AD FS). Configure the OAuth client to do the same token transformation as your vCenter Server system . You must configure a redirect URL according to the requirements in the procedure below. Save the Client ID and Client Secret that are generated by the authentication server. For more information, see the Microsoft documentation.