# Ldap Realm elasticsearch 5.4

**URL:** <https://discuss.elastic.co/t/ldap-realm-elasticsearch-5-4/93730>\
**Category:** Elasticsearch\
**Created:** [July 19, 2017, 9:23am UTC](https://discuss.elastic.co/t/ldap-realm-elasticsearch-5-4/93730 "2017-07-19T09:23:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mehdi\_Chilla](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mehdi_chilla/32/17579_2.png) [@Mehdi\_Chilla](https://discuss.elastic.co/u/Mehdi_Chilla)\
**Post date:** [July 19, 2017, 9:23am UTC](https://discuss.elastic.co/t/ldap-realm-elasticsearch-5-4/93730/1 "2017-07-19T09:23:02Z")

</div>

Hello,

I try to configure the x-pack with two groups coming from an LDAP, 1 with access in writing and another one in reading of the dashboards.

Here is the current configuration.

> xpack:  
> security:  
> authc:  
> realms:  
> ldap1:  
> type: ldap  
> order: 0  
> url: "ldap://xxxxx.xx.xxx:xxx"  
> bind\_dn: "cn=xxx xxx"  
> bind\_password: xxx  
> user\_search:  
> base\_dn: "ou=applications,dc=xxx,dc=xxx"  
> files:  
> role\_mapping: "/explproc/DEVELS1/elasticsearch/config/xpack/role\_mapping.yml"  
> unmapped\_groups\_as\_roles: false  
> native:  
> type: native  
> order: 1
> 
> pilwrite:
> 
> - "cn=PIL\_ADM,cn=pilotageTempsReel,ou=applications,dc=xx,dc=xx"  
> pilread:
> - "cn=CAS\_MANAGER,cn=pilotageTempsReel,ou=applications,dc=xx,dc=xx"

It works when I specify the exact UID in role\_mapping.yml (I have a hundred to authorize) but when I try to indicate the name of the group ldap it recognizes the identifiers but does not affect them any roles

Thank you in advance for your assistance

Mehdi

---

<div class="post-metadata">

**Author:** ![TimV](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timv/32/13162_2.png) [@TimV](https://discuss.elastic.co/u/TimV)\
**Post date:** [July 21, 2017, 6:47am UTC](https://discuss.elastic.co/t/ldap-realm-elasticsearch-5-4/93730/2 "2017-07-21T06:47:00Z")

</div>

It doesn't appear that you have configured your realm to extract groups from your directory.

Depending on how your directory is configured, you will either want to set:

- `user_group_attribute`

or _both_

- `group_search.base_dn` _and_
- `group_search. user_attribute`
- _and maybe_ `group_search.filter` as well.

Those settings are explained at [https://www.elastic.co/guide/en/x-pack/current/ldap-realm.html](https://www.elastic.co/guide/en/x-pack/current/ldap-realm.html)

For most directories, the `group_search` configuration is what you want to use, but without more details on how your directory is structured, I can't offer anything more specific.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 18, 2017, 6:47am UTC](https://discuss.elastic.co/t/ldap-realm-elasticsearch-5-4/93730/3 "2017-08-18T06:47:28Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
