Hello, I have configured LDAP with opendistro. meanwhile i ran the ldapsearch command, it could be authenticate with user password. but I am running this commmand “curl -XGET “http://127.0.0.1:9200/_search” -H ‘Content-Type: application/json’ -d’
{
“query”: {
“match_all”: {}
}
}’ -u esuser1 --insecure”
it is showing me to unathorized. below is my cofig.yml file
authc:
ldap:
http_enabled: true
transport_enabled: true
order: 1
http_authenticator:
type: basic
challenge: false
authentication_backend:
# LDAP authentication backend (authenticate users against a LDAP or Active Directory)
type: ldap
config:
# enable ldaps
enable_ssl: false
# enable start tls, enable_ssl should be false
enable_start_tls: false
# send client certificate
enable_ssl_client_auth: false
# verify ldap hostname
verify_hostnames: true
hosts:
- 10.0.1.103:389
bind_dn: cn=esuser1 rp,OU=test,dc=testad,dc=com
password: test@321!
userbase: ‘OU=test,dc=testad,dc=com’
# Filter to search for users (currently in the whole subtree beneath userbase)
# {0} is substituted with the username
usersearch: ‘(sAMAccountName={0})’
# Use this attribute from the user as username (if not set then DN is used)
username_attribute: uid
authz:
roles_from_myldap:
http_enabled: true
transport_enabled: true
authorization_backend:
# LDAP authorization backend (gather roles from a LDAP or Active Directory, you have to configure the above LDAP authentication backend settings too)
type: ldap
config:
# enable ldaps
enable_ssl: false
# enable start tls, enable_ssl should be false
enable_start_tls: false
# send client certificate
enable_ssl_client_auth: false
# verify ldap hostname
verify_hostnames: true
hosts:
- 10.0.1.103:389
bind_dn: cn=esuser1 rp,OU=test,dc=testad,dc=com
password: test@321!
rolebase: ‘ou=groups,dc=testad,dc=com’
# Filter to search for roles (currently in the whole subtree beneath rolebase)
# {0} is substituted with the DN of the user
# {1} is substituted with the username
# {2} is substituted with an attribute value from user’s directory entry, of the authenticated user. Use userroleattribute to specify the name of the attribute
rolesearch: ‘(member={0})’
# Specify the name of the attribute which value should be substituted with {2} above
userroleattribute: null
# Roles as an attribute of the user entry
#userrolename: disabled
userrolename: ‘memberOf’
# The attribute in a role entry containing the name of that role, Default is “name”.
# Can also be “dn” to use the full DN as rolename.
rolename: cn
# Resolve nested roles transitive (roles which are members of other roles and so on …)
resolve_nested_roles: true
userbase: ‘OU=test,dc=testad,dc=com’
# Filter to search for users (currently in the whole subtree beneath userbase)
# {0} is substituted with the username
usersearch: ‘(uid={0})’
# Skip users matching a user name, a wildcard or a regex pattern
#skip_users:
# - ‘cn=Michael Jackson,oupeople,o=TEST’
# - '/\S/’
Here is my elasticsearch log.
Unable to connect to ldapserver testad.com:389 due to [org.ldaptive.LdapException@1472499645::resultCode=INVALID_CREDENTIALS, matchedDn=null, responseControls=null, referralURLs=null, messageId=-1, message=javax.naming.AuthenticationException: [LDAP: error code 49 - 80090308: LdapErr: DSID-0C09042A, comment: AcceptSecurityContext error, data 52e, v3839], providerException=javax.naming.AuthenticationException: [LDAP: error code 49 - 80090308: LdapErr: DSID-0C09042A, comment: AcceptSecurityContext error, data 52e, v3839]]. Try next.
[2019-12-17T10:58:33,988][WARN ][c.a.o.s.a.BackendRegistry] [ZaCBDvI] Authentication finally failed for esuser1 from 127.0.0.1:51872
[2019-12-17T10:58:33,998][INFO ][o.e.c.m.MetaDataMappingService] [ZaCBDvI] [security-auditlog-2019.12.17/6jKV-ZPFSTKj1Xo5gxBggQ] update_mapping [auditlog]
Need some help.