REST Api - Simple Authentication With Ldap User

curl -X POST https://{your frappe instance}/api/method/login
-H ‘Content-Type: application/json’
-H ‘Accept: application/json’
-d ‘{“usr”:“Administrator”,“pwd”:“admin”}’

When I use this method with erpnext user, authentacation is success.

{
    "message": "Logged In",
    "home_page": "/app",
    "full_name": "Administrator"
}

But When I use login with ldap user, return this;

{
    "message": "Invalid login credentials",
    "exception": "frappe.exceptions.AuthenticationError",
    "exc": "[\"Traceback (most recent call last):\\n  File \\\"apps/frappe/frappe/app.py\\\", line 56, in application\\n    init_request(request)\\n  File \\\"apps/frappe/frappe/app.py\\\", line 131, in init_request\\n    frappe.local.http_request = frappe.auth.HTTPRequest()\\n  File \\\"apps/frappe/frappe/auth.py\\\", line 37, in __init__\\n    self.set_session()\\n  File \\\"apps/frappe/frappe/auth.py\\\", line 74, in set_session\\n    frappe.local.login_manager = LoginManager()\\n  File \\\"apps/frappe/frappe/auth.py\\\", line 121, in __init__\\n    if self.login() == False:\\n  File \\\"apps/frappe/frappe/auth.py\\\", line 144, in login\\n    self.authenticate(user=user, pwd=pwd)\\n  File \\\"apps/frappe/frappe/auth.py\\\", line 246, in authenticate\\n    self.fail(\\\"Invalid login credentials\\\")\\n  File \\\"apps/frappe/frappe/auth.py\\\", line 301, in fail\\n    raise frappe.AuthenticationError\\nfrappe.exceptions.AuthenticationError\\n\"]"
}

Hii @gelveri

Please refer to:

Bro, my ldap integration is working. My users can log in. I have no problem here.

My problem is this;
My local users can log in with the post method using the rest api in the documentation. But only with this method my ldap users cannot log in.