# Error: The supplied credential is invalid in LDAP Authentication Plugin

**URL:** https://discuss.konghq.com/t/error-the-supplied-credential-is-invalid-in-ldap-authentication-plugin/268
**Category:** Questions
**Created:** [December 20, 2017, 2:13pm UTC](https://discuss.konghq.com/t/error-the-supplied-credential-is-invalid-in-ldap-authentication-plugin/268 "2017-12-20T14:13:40Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![mohdnajdy](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/mohdnajdy/32/94_2.png) [@mohdnajdy](https://discuss.konghq.com/u/mohdnajdy)
#### Post date: [December 20, 2017, 2:13pm UTC](https://discuss.konghq.com/t/error-the-supplied-credential-is-invalid-in-ldap-authentication-plugin/268/1 "2017-12-20T14:13:40Z")

</div>

Hello, I am trying to set the ldap-auth plugin to be on all apis.  
My configuration for this plugin is:

```
curl -X POST http://localhost:8001/plugins/
--data "name=ldap-auth" 
--data "config.hide_credentials=false" 
--data "config.ldap_host=10.180.20.1" 
--data "config.ldap_port=389" 
--data "config.base_dn=OU=Employees,OU=COMPANY-USERS,DC=test,DC=com" 
--data "config.attribute=cn" 
--data "config.cache_ttl=60"

```

I consume the api using

```
curl -H "Authorization: LDAP <base64(cn:password)>" http://localhost:8000/details/

```

Everything from here is working fine, But when i set the **config.attribute=samaccountName**  
The kong logs gives me

> Error: The supplied credential is invalid.  
> Details: 80090308: LdapErr: DSID-0C0903D0, comment: AcceptSecurityContext error, data 52e, v2580

Attribute that works are cn and name but anything else do not like samaccountName or email.

---

<div class="post-metadata">

### Author: ![kikito](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/kikito/32/15_2.png) [@kikito](https://discuss.konghq.com/u/kikito)
#### Post date: [December 21, 2017, 3:03pm UTC](https://discuss.konghq.com/t/error-the-supplied-credential-is-invalid-in-ldap-authentication-plugin/268/2 "2017-12-21T15:03:19Z")

</div>

Hello,

What you are describing should in fact work.

Just to clarify: can you confirm after changing the attribute to `samaccountName`, you also changed the base64 calculation used in curl so that it used `samaccountName` instead of `cn`?

---

<div class="post-metadata">

### Author: ![mohdnajdy](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/mohdnajdy/32/94_2.png) [@mohdnajdy](https://discuss.konghq.com/u/mohdnajdy)
#### Post date: [December 22, 2017, 6:49pm UTC](https://discuss.konghq.com/t/error-the-supplied-credential-is-invalid-in-ldap-authentication-plugin/268/3 "2017-12-22T18:49:41Z")

</div>

Thanks for responding,

I did change it so be the base64(samaccountname:password) and it is still giving me the same error.  
I am not sure if there is other place i should be looking at. I have tested the samaccountname with the a python code to authenticate and it was working fine.

---

<div class="post-metadata">

### Author: ![gansa1986](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/gansa1986/32/520_2.png) [@gansa1986](https://discuss.konghq.com/u/gansa1986)
#### Post date: [March 7, 2019, 8:24pm UTC](https://discuss.konghq.com/t/error-the-supplied-credential-is-invalid-in-ldap-authentication-plugin/268/4 "2019-03-07T20:24:05Z")

</div>

I do have the same issue, Any updates on this?

---

<div class="post-metadata">

### Author: ![JosephTsang](https://avatars.discourse-cdn.com/v4/letter/j/e19adc/32.png) [@JosephTsang](https://discuss.konghq.com/u/JosephTsang)
#### Post date: [May 29, 2019, 4:41am UTC](https://discuss.konghq.com/t/error-the-supplied-credential-is-invalid-in-ldap-authentication-plugin/268/5 "2019-05-29T04:41:00Z")

</div>

I also got the same error when using the attribute “sAMAccountName”  
Anyone can help?

Kong version: 1.1.2

---

<div class="post-metadata">

### Author: ![littlechicks](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/littlechicks/32/1389_2.png) [@littlechicks](https://discuss.konghq.com/u/littlechicks)
#### Post date: [October 14, 2019, 2:04pm UTC](https://discuss.konghq.com/t/error-the-supplied-credential-is-invalid-in-ldap-authentication-plugin/268/8 "2019-10-14T14:04:38Z")

</div>

Hello,

I have the same issue.  
I think the kong ldap plugin is considering only CN attributes. I

I’ve opened an issue on github:

> <https://github.com/Kong/kong/issues/5121>
>
> I am using Kong over Kubernetes.
> I have tried to use the LDAP AUTH with this configuration
> {
> “id”: “93dsd0bfa-g851-4953-abdkje54-b7461545S806”,
> “name”: “ldap-auth”,
> “enabled”: true,
> “created\_at”: 1479514353000,
> “config”: {
> “attribute”:...

Hope someone will fix it 🙂

---

<div class="post-metadata">

### Author: ![evertonpavan](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/evertonpavan/32/2774_2.png) [@evertonpavan](https://discuss.konghq.com/u/evertonpavan)
#### Post date: [June 1, 2021, 5:12pm UTC](https://discuss.konghq.com/t/error-the-supplied-credential-is-invalid-in-ldap-authentication-plugin/268/9 "2021-06-01T17:12:17Z")

</div>

Hello guys!

I have the same issue to configure the plugin.

Can someone help me, please?
