+ Below errors reported when trying to login to Greenplum database using a LDAP / LDAP secure protocol wherein users are defined in the Active Directory.
psql: error: could not initiate GSSAPI security context: Unspecified GSS failure. Minor code may provide more information: Server not found in Kerberos database
FATAL: LDAP authentication failed for user "username"
+ LDAP string for pg_hba.conf so that users managed by Active directory can able to login using a single application userid to Greenplum.
All greenplum versions.
The underlying issue could be direct connection to an AD/LDAP server versus Virtual IP.
In most cases VIP will be a load balancer of other AD servers, so we need to determine whether the issue is because of VIP or the AD server itself
Recommendations to follow for a successful LDAP group authentication:
For Active Directory:
ldapsearchfilter="(&(objectClass=user)(sAMAccountName=%u)(memberof=CN=YourGroup,OU=Groups,DC=example,DC=com))"
For OpenLDAP:
ldapsearchfilter="(&(objectClass=posixGroup)(memberUid=%u))"
Ensure that the LDAP server (e.g., OpenLDAP, Active Directory) is correctly configured and operational. This can be verified by running `ldapsearch` with same parameters as the pg_hba entry. For example,
ldapsearch -x -LLL -H ldap://<hostname> -D "<service_account_dn>" -b "<base_dn>" -w <password> "(&(objectClass=Person)(memberof=<group_dn>))"
Create roles for both users and group and assign permissions
CREATE ROLE <user>;
ALTER ROLE <user> WITH LOGIN;
CREATE ROLE <group>;
GRANT <group> TO <user>; Troubleshoot `LDAP authentication failed` issue:
ldapbasedn="ou=users,dc=example,dc=com"
NOTE - Try both VIP and an IP (or URL) to of a particular AD server to figure out which one is causing the issue.