# LDAP cross-forest authentication

**URL:** <https://discuss.elastic.co/t/ldap-cross-forest-authentication/222837>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-security\
**Created:** [March 10, 2020, 2:17am UTC](https://discuss.elastic.co/t/ldap-cross-forest-authentication/222837 "2020-03-10T02:17:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![wyh\_ryan](https://avatars.discourse-cdn.com/v4/letter/w/a5b964/32.png) [@wyh\_ryan](https://discuss.elastic.co/u/wyh_ryan)\
**Post date:** [March 10, 2020, 2:17am UTC](https://discuss.elastic.co/t/ldap-cross-forest-authentication/222837/1 "2020-03-10T02:17:13Z")

</div>

Hi, I'm trying to authenticate users via AD.

I have 2 forests: [A.COM](http://A.COM) and [B.ORG](http://B.ORG) which have a trust relationship between them. I can bind to [A.COM](http://A.COM) and perform a search there while [B.ORG](http://B.ORG) has all the users.

When a user requests to log in, I'm trying to connect to [A.COM](http://A.COM) and search for this user inside [B.ORG](http://B.ORG) for authentication.  
 ![Untitled Diagram](https://us1.discourse-cdn.com/elastic/original/3X/e/6/e6ac43e50bb61c854ba51c9b63cf0faa3c21cf31.jpeg)

My current configuration is

```auto
active_directory:
      ldap:
             order: 1
             domain_name: A.COM
             url: ["ldap://A_COM_IP_ADDRESS:389"]
             bind_dn: "BIND_DN"
             bind_password: "BIND_PW"

```

This config works for authentication within one forest, but fails in the cross-forest senario. The log shows `authenticate failed (Caused by LDAPException(resultCode=49 (invalid credentials), diagnosticMessage='80090308: LdapErr: DSID-0C090400, comment: AcceptSecurityContext error, data 52e, v1db1^@', ldapSDKVersion=4.0.8, revision=28812`

How can I achieve this implementation? Thanks.

---

<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:** [April 7, 2020, 2:17am UTC](https://discuss.elastic.co/t/ldap-cross-forest-authentication/222837/2 "2020-04-07T02:17:16Z")

</div>

Closed on April 7, 2020, 2:17am UTC

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