# Configure authentication using Active Directory

You can configure vCenter and NSX in Google Cloud VMware Engine to use your
on-premises Active Directory as an LDAP or LDAPS identity source for user authentication.
Once setup is complete, you can provide access to vCenter and NSX Manager and
assign required roles for managing your private cloud.

> [!CAUTION]
> **Caution:** Joining your private cloud vCenter to an Active Directory domain is unsupported and unnecessary. Your private cloud vCenter server only supports the **Active Directory over LDAP** identity source type, which doesn't require joining your vCenter to an Active Directory domain. Avoid the **Active Directory
> (Windows Integrated Authentication)** identity source type.

## Before you begin

The steps in this document assume that you first do the following:

- [Establish connectivity from your on-premises network to your private cloud](https://docs.cloud.google.com/vmware-engine/docs/networking/howto-connect-to-onpremises.md.txt)
- Enable DNS name resolution of your on-premises Active Directory:
  - For *Legacy VMware Engine Networks* : Enable DNS name resolution of your on-premises Active Directory by creating [DNS forwarding rules](https://docs.cloud.google.com/vmware-engine/docs/networking/howto-legacy-conditional-dns-forwarding.md.txt) in your private cloud.
  - For *Standard VMware Engine Networks* : Enable DNS name resolution of your on-premises Active Directory by configuring [DNS bindings](https://docs.cloud.google.com/vmware-engine/docs/networking/howto-create-dns-bindings.md.txt) to your VMware Engine network.

The following table lists the information you need when setting up your
on-premises Active Directory domain as an SSO identity source on vCenter and
NSX. Gather the following information before setting up SSO identity sources:

| Information | Description |
|---|---|
| Base DN for users | The base distinguished name for users. |
| Domain name | The FQDN of the domain, for example, `example.com`. Don't provide an IP address in this field. |
| Domain alias | The domain NetBIOS name. If you use SSPI authentication, add the NetBIOS name of the Active Directory domain as an alias of the identity source. |
| Base DN for groups | The base distinguished name for groups. |
| Primary server URL | The primary domain controller LDAP server for the domain. Use the format `ldap://hostname:port` or `ldaps://hostname:port`. The port is typically 389 for LDAP connections and 636 for LDAPS connections. For Active Directory multi-domain controller deployments, the port is typically 3268 for LDAP and 3269 for LDAPS. When you use `ldaps://` in the primary or secondary LDAP URL, you must provide a Base64-encoded X.509 certificate in PEM or CER format that establishes trust for the full certificate path, including the root certificate authority (CA) certificate and any intermediate CA certificates. |
| Secondary server URL | The address of a secondary domain controller LDAP server that is used for failover. |
| Choose certificate | To use LDAPS with your Active Directory LDAP server or OpenLDAP server identity source, click the **Choose certificate** button that appears after you type `ldaps://` in the URL field. A secondary server URL isn't required. Upload a PEM-encoded or CER-encoded X.509 certificate file that includes the root CA certificate and any intermediate CA certificates in the trust chain. Because domain controllers typically don't send the root CA certificate during the TLS handshake, uploading only the domain controller leaf certificate causes TLS validation to fail and returns a `Can't contact LDAP server` error even when TCP connectivity on port 636 or 3269 succeeds. |
| Username | The ID of a user in the domain who has a minimum of read-only access to the base DN for users and groups. |
| Password | The password of the user who is specified by **Username**. |

## Add an identity source on vCenter

The following steps describe how to add your on-premises Active Directory as an
LDAP server on vCenter:

1. Sign in to the vCenter for your private cloud using a [solution user account](https://docs.cloud.google.com/vmware-engine/docs/private-clouds/howto-elevate-privilege.md.txt#solution_user_accounts).
2. Select **Home \> Administration**.
3. Select **Single Sign On \> Configuration**.
4. Open the **Identity Sources** tab and click **+Add** to add a new identity source.
5. Select **Active Directory as an LDAP Server** , and click **Next**.
6. Specify the identity source parameters for your environment. If you enter an `ldaps://` URL, click **Choose certificate** and upload the Base64-encoded X.509 certificate file that contains your root CA certificate and any intermediate CA certificates, and then click **Next**.
7. Review the settings, and click **Finish**.

## Add an identity source on NSX

These steps describe how to add an identity source in NSX Manager. If you want
to automate this configuration, you can use the
[NSX-T API](https://docs.cloud.google.com/vmware-engine/docs/vmware-platform/nsx-t-public-api).

1. Sign in to NSX Manager in your private cloud.
2. Go to **System \> Settings \> Users and Roles \> LDAP**.
3. Click **Add identity source**.
4. In the **Name** field, enter a display name for the identity source.
5. Specify the **Domain Name** and **Base DN** of your identity source.
6. In the **Type** column, select **Active Directory over LDAP**.
7. In the **LDAP Servers** column, click **Set** .
8. In the **Set LDAP Server** window, click **Add LDAP Server**.
9. Specify the LDAP server parameters. If you select **LDAPS** as the protocol, provide the Base64-encoded X.509 certificate that contains your root CA certificate and any intermediate CA certificates in the **Certificates** field, and then click **Check status** to verify the connection from NSX Manager to your LDAP server.
10. Click **Add** to add the LDAP server.
11. Click **Apply** and then click **Save**.

## Ports required for using on-premises Active Directory as an identity source

The ports listed in the following table are required to configure your
on-premises Active Directory as an identity source on the private cloud vCenter.

| Port | Source | Destination | Purpose |
|---|---|---|---|
| 53 (UDP) | Private cloud DNS servers | On-premises DNS servers | Required for forwarding DNS lookup of on-premises Active Directory domain names from a private cloud vCenter server to an on-premises DNS server. |
| 389 (TCP/UDP) | Private cloud management network | On-premises Active Directory domain controllers | Required for LDAP communication from a private cloud vCenter server to Active Directory domain controllers for user authentication. |
| 636 (TCP) | Private cloud management network | On-premises Active Directory domain controllers | Required for secure LDAP (LDAPS) communication from a private cloud vCenter server to Active Directory domain controllers for user authentication. |
| 3268 (TCP) | Private cloud management network | On-premises Active Directory global catalog servers | Required for LDAP communication in multi-domain controller deployments. |
| 3269 (TCP) | Private cloud management network | On-premises Active Directory global catalog servers | Required for LDAPS communication in multi-domain controller deployments. |
| 8000 (TCP) | Private cloud management network | On-premises network | Required for vMotion of virtual machines from the private cloud network to the on-premises network. |

## What's next

For more information about SSO identity sources, see the following vSphere and
NSX Data Center documentation:

- [Add or Edit a vCenter Single Sign-On Identity Source](https://docs.vmware.com/en/VMware-vSphere/7.0/com.vmware.vsphere.authentication.doc/GUID-B23B1360-8838-4FF2-B074-71643C4CB040.html).
- [LDAP Identity Source](https://docs.vmware.com/en/VMware-NSX-T-Data-Center/3.0/administration/GUID-664DC51F-3D6B-442F-9C29-2A5304ACCCA4.html).