Version: 4.2.18-18
Error:
mongo localhost:27030 -u st432az --authenticationDatabase=‘$external’ --authenticationMechanism=PLAIN -p
LDAP search failed with error: Referral
Config:
security:
authorization: enabled
ldap:
authz:
queryTemplate: ‘{USER}?memberOf?base’
bind:
method: simple
queryPassword: secret
queryUser: CN=s-User,OU=ServiceAccounts,OU=Automation,OU=Users,OU=Production,OU=BlueForest,DC=abc,DC=def,DC=com
servers: abc.def.com:3269
transportSecurity: tls
userToDNMapping: ‘[{ match: “(.+)”, ldapQuery: “DC=xxx,DC=com??sub?(sAMAccountName={0})”}]’
validateLDAPServerConfig: true
setParameter:
authenticationMechanisms: SCRAM-SHA-1,PLAIN
ldapFollowReferrals: true
Error log:
2022-04-27T21:05:28.344+0000 I COMMAND [conn9] command admin.$cmd appName: “MongoDB Shell” command: isMaster { isMaster: 1, saslSupportedMechs: “$external.st432az”, hostInfo: “xxx.com:27017”,
client: { application: { name: “MongoDB Shell” }, driver: { name: “MongoDB Internal Client”, version: “4.2.18-18” }, os: { type: “Linux”, name: “Red Hat Enterprise Linux Server release 7.9 (Maipo)”, architecture: “x86_64”, version:
“Kernel 3.10.0-1160.59.1.el7.x86_64” } }, $db: “admin” } numYields:0 ok:0
errMsg:“LDAP search failed with error: Referral” errName:LDAPLibraryError errCode:9390 reslen:146 locks:{} protocol:op_query 508910ms