Hi, I want to swich my rs cluster from sasl-ldap to direct ldap conection, this is my configuration:
systemLog:
destination: file
path: /data/mongod.log
logAppend: true
logRotate: reopen
component:
accessControl:
verbosity: 5
storage:
engine: wiredTiger
dbPath: /data/db
directoryPerDB: true
journal:
enabled: true
wiredTiger:
engineConfig:
cacheSizeGB: 1
directoryForIndexes: true
processManagement:
fork: true
net:
bindIp: 127.0.0.1,192.168.0.20
port: 27017
operationProfiling:
slowOpThresholdMs: 100
replication:
replSetName: rs1
oplogSizeMB: 256
security:
keyFile: /data/keyfile
clusterAuthMode: keyFile
authorization: enabled
ldap:
servers: 'ldap.domain.com:10389'
transportSecurity: 'none'
bind:
method: 'simple'
queryUser: 'uid=nobody,ou=people,dc=domain,dc=com'
queryPassword: 'pass123'
userToDNMapping:
'[
{
match: "(.+)",
ldapQuery: "ou=people,dc=domain,dc=com??sub?(&(uid={0})(!(pwdAccountLockedTime=*))(!(description=tech)))"
}
]'
authz:
queryTemplate: 'ou=groups,dc=domain,dc=com??sub?(&(objectClass=groupOfUniqueNames)(description=mongo)(uniqueMember={USER}))'
setParameter:
authenticationMechanisms: "PLAIN,SCRAM-SHA-1,SCRAM-SHA-256"
next create user in $external database:
> db.createUser({"user": "user", "roles": [{"role": "read", "db": "db1"}], "mechanisms": ["PLAIN"] })
Successfully added user: {
"user" : "user",
"roles" : [
{
"role" : "read",
"db" : "db1"
}
],
"mechanisms" : [
"PLAIN"
]
}
during connection to mongo I get error:
> db.auth({"mechanism": "PLAIN", "user": "user", "pwd": passwordPrompt(), "digestPassword ": false})
Enter password:
Error: SASL(-4): no mechanism available: No worthy mechs found
0
In my ldap I store passwords in two hash:
sambaNTPassword
userPassword: ssha hash
Please help me, what I’m doing wrong?