The Google Workspace Secure LDAP service offers a streamlined and secure method to integrate your LDAP-based applications and services with Cloud Identity or Google Workspace. This guide provides comprehensive information for Google Workspace administrators to understand, set up, manage, and troubleshoot the Secure LDAP service, leveraging Cloud Directory as a robust cloud-based LDAP server for authentication, authorization, and directory lookups.
By utilizing Secure LDAP, organizations can minimize their reliance on traditional, on-premise directory servers, consolidating authentication and directory services within Google's cloud infrastructure. This service supports various LDAP-based applications and IT infrastructure, whether they are on-premise or hosted on Infrastructure-as-a-Service (IaaS) platforms like Google Compute Engine, AWS, or Azure.
The Secure LDAP service is available for various Google Workspace and Cloud Identity editions, including Frontline Standard and Plus, Business Plus, Enterprise Standard and Plus, Education Fundamentals, Standard and Plus, and Enterprise Essentials Plus.
The Secure LDAP service facilitates communication between your LDAP-based applications and Google Cloud Directory. It acts as a cloud-based LDAP server, allowing applications to query user and group information and authenticate users securely. The core of this service relies on TLS client certificates for authentication, with an optional username and password (access credentials) for clients that require them.
When a user account is suspended in Google Workspace or Cloud Identity, it cannot sign in to any associated applications, including LDAP applications. While suspended accounts cannot verify passwords via LDAP, their information can still be retrieved through an LDAP search by a client service.
It is important to note that configuring a third-party Identity Provider (IdP) or Single Sign-On (SSO) provider in Google Workspace or Cloud Identity does not impact the Secure LDAP service. Third-party IdPs only affect HTTP-based transactions (e.g., SAML-based authentication). For Secure LDAP connected applications, users must use their Google username and password for authentication, not their third-party IdP credentials.
The Secure LDAP service exposes Google Cloud Directory objects to LDAP clients following a specific hierarchy and set of attributes.
The directory structure in Secure LDAP mirrors the organizational unit (OU) tree configured in your Google Admin console. Below is a sample hierarchy:
<root>
cn=subschema
dc=example,dc=com
ou=Users
ou=Sales
uid=lisasmith
uid=jimsmith
ou=Groups
cn=group1
cn=group2
dc=example,dc=com). It contains subdomains, users, groups, and organizational units.objectClass: top, domain, dcObjectdc: Domain component namehasSubordinates: TRUEobjectClass: top, organizationalUnitou: Name of the organizational unitdescription: Human-readable descriptionhasSubordinates: TRUEobjectClass: top, person, organizationalPerson, inetOrgPerson, posixAccountuid: User's username (portion of email address)googleUid: Same as uid, for unambiguous distinction from posixUidposixUid: User's username or POSIX username if setcn: Common name (username and display name)sn: SurnamegivenName: Given namedisplayName: Full namemail: Email addressmemberOf: List of fully qualified group namestitle: User's titleemployeeNumber: User's employee IDemployeeType: User's roledepartmentNumber: Department namephysicalDeliveryOfficeName: Location/addressjpegPhoto: User's profile photo (returned only when explicitly requested)entryUuid: Universally unique stable identifier (returned only when explicitly requested)objectSid: Windows-compatible security identifier (returned only when explicitly requested)uidNumber: POSIX UID number (searchable if set via Admin SDK API along with posixAccount systemId)gidNumber: POSIX GID number for primary group (searchable if set via Admin SDK API along with posixAccount systemId)homeDirectory: POSIX home directory (defaults to /home/<username>)loginShell: POSIX login shell (defaults to /bin/bash)gecos: GECOS (historical) attributeshasSubordinates: FALSEobjectClass: top, groupOfNames, posixGroupcn: Group's domain-unique namedisplayName: Human-readable display namedescription: Longer human-readable descriptiongidNumber: POSIX GID number (stable unique ID, but not efficiently searchable)entryUuid: Universally unique stable identifierobjectSid: Windows-compatible security identifiermember: List of fully qualified names of group membersmemberUid: List of usernames of group membersgoogleAdminCreated: True if the group was created by an administratorhasSubordinates: FALSESetting up the Secure LDAP service involves a series of steps in the Google Admin console and on your LDAP clients.
The general process for setting up the Secure LDAP service is as follows:
First, you need to register your LDAP-based applications or services as "LDAP clients" within the Google Admin console. This step is the initial configuration before setting up access permissions or connecting the clients.
After adding an LDAP client, you must configure its access permissions. This involves specifying which organizational units (OUs) or groups the client can verify credentials for, read user information from, and read group information from. For example, if an LDAP client performs user lookups during authentication (like Atlassian Jira or SSSD), you need to enable "Read user information" for the relevant OUs.
The Secure LDAP service primarily uses TLS client certificates for authentication. After configuring an LDAP client, you will download a unique client certificate and key pair from the Google Admin console. This certificate must then be uploaded to your LDAP client to establish a secure connection.
Connecting your LDAP client involves configuring its settings to point to ldap.google.com and installing the downloaded client certificate. The specific steps vary significantly depending on the type of LDAP client you are using. It is crucial to consult your vendor's documentation in addition to the generic instructions provided.
For most LDAP clients, you will need the following basic connection information:
ldap.google.com389 for LDAP with StartTLS enabled636 for LDAPS (SSL/TLS enabled)dc=example,dc=com for example.com).ldap-client.crt and ldap-client.key are common filenames).The guide provides detailed instructions for various clients, including but not limited to:
stunnel as a proxy due to lack of direct digital certificate support.freeradius-ldap, copying certificate/key, enabling the LDAP module, and editing configuration files.LDAPTLS_CERT, LDAPTLS_KEY, LDAPTLS_IDENTITY for macOS) and running ldapsearch commands. For macOS, importing into Keychain Access and setting up Access Control is necessary.openvpn-auth-ldap, copying certificate/key, and configuring auth-ldap.conf and server.conf..pem file, and configuring ldap.conf and the Splunk web UI.sssd-ldap, copying certificate/key, creating sssd.conf, and setting permissions. Requires "Read user information" and "Read group information" to be enabled in Admin console.For LDAP clients that do not inherently support authentication with TLS client certificates, stunnel can be used as a proxy. stunnel provides the client certificate to the Secure LDAP server, while your application connects to stunnel using plain LDAP without StartTLS/SSL/TLS. It is recommended to run stunnel on the same server as your application and listen locally to avoid exposing your LDAP directory.
After connecting your LDAP client and verifying its configuration, the final step in the setup process is to switch the service status to "On" for the LDAP client in the Google Admin console.
As an administrator, you can review and take action on Secure LDAP log events to monitor usage and security. These events are accessible through the Audit and investigation tool or, for supported editions, the Security investigation tool.
These logs provide information about administrative actions related to the Secure LDAP service.
These logs detail the operations performed by LDAP clients connecting to the Secure LDAP service. Examples include Bind Failed, Search Successful, or Unbind.
The ability to search depends on your Google Workspace edition, administrative privileges, and the data source.
You can manage the display and export of search results:
You can set up alerts based on log event data using reporting rules or create activity rules in the security investigation tool to automate actions and alerts.
If you encounter issues with the Secure LDAP service, several troubleshooting steps can help identify and resolve the problem.
The Secure LDAP service returns specific error codes when issues occur during connection or subsequent LDAP queries. These errors are also visible in audit logs.
PROTOCOL_ERROR (2):AUTH_METHOD_NOT_SUPPORTED (7):ADMIN_LIMIT_EXCEEDED (11):ou=Groups,dc=example,dc=com instead of dc=example,dc=com if only groups are needed). Ensure Splunk version 8.1.4 or later is used to avoid excessive queries.CONFIDENTIALITY_REQUIRED (13):NO_SUCH_OBJECT (32):INVALID_DN_SYNTAX (34):INAPPROPRIATE_AUTHENTICATION (48):INSUFFICIENT_ACCESS_RIGHTS (50):UNWILLING_TO_PERFORM (53):OTHER (80):CANCELED (118):Before contacting Google Support, perform basic connectivity tests using simple tools.
Verify Connectivity and Run an LDAP Query:
ldapsearch (Linux/macOS): Use this utility to make a basic LDAP query. A successful result indicates that the LDAP client, TLS session, and TCP connection are working.
bash
LDAPTLS_CERT={crt_file} LDAPTLS_KEY={key_file} ldapsearch -H ldaps://ldap.google.com:636 -b dc={domain},dc={domain} '(mail={user_email})'
Replace placeholders with your .crt file, .key file, domain components (e.g., dc=example,dc=com), and a user's primary email.SASL/EXTERNAL authentication started, ldap_sasl_interactive_bind_s: Unknown authentication method (-6) additional info: SASL(-4): no mechanism available. This often indicates the OpenLDAP client/library is compiled without SNI support. Check for OU=No SNI provided; please fix your client. in ldapsearch -d5 output.ldapsearch returns success (status 0) but no users. This can happen if -x (use SASL authentication) is used with client certificates; remove -x.ldap.google.com (Port 636, Use SSL-based Encryption checked) and specify your Base DN. Optionally, provide access credential username/password.ldp.exe (Windows): Convert your certificate and key to PKCS12 format, import into the Windows certificate store, then run ldp.exe and connect to ldap.google.com:636 with SSL checked. View the tree with your Base DN.Basic Connectivity Testing (if LDAP query fails):
bash
openssl s_client -connect ldap.google.com:636
Look for Verify return code: 0 (ok) at the end of the output. If Verify return code: 18 (self signed certificate) or depth=0 OU = "No SNI provided; please fix your client.", CN = invalid2.invalid appears, your TLS client might not support SNI.nc (netcat) or telnet (macOS): Verify TCP connectivity.
bash
nc -zv ldap.google.com 636
If you get "Connection refused", it might indicate a firewall issue. Use tcptraceroute ldap.google.com 636 to investigate./LDAPv3/ldap.google.com node to see if users and groups from your Google domain are visible.stunnel as a proxy between your application and Secure LDAP. stunnel will handle the TLS certificate authentication with Google, while your application connects to stunnel without certificate support.