Almas
Almas

Reputation: 73

LDAP Authentication with Django Rest Framework

I am new to Django and i am using Django Rest Framework for Backend. I followed this tutorial to add Ldap authenrication to my Django Rest Framework project.

AUTH_LDAP_SERVER_URI = "ip"
AUTH_LDAP_BIND_DN = "dn"
AUTH_LDAP_BIND_PASSWORD = "password"
AUTH_LDAP_USER_DN_TEMPLATE = "uid=%(user)s,tempelate"

but when i try to login i get the error

{
  "non_field_errors": [
    "Unable to log in with provided credentials."
  ]
}

Where did i go wrong. The IP points to the correct address of Active Directory, the bind DN and Passwords are the ones i used in my Moodle Application and they work.I believe AUTH_LDAP_USER_DN_TEMPLATE corresponds to context.

AUTHENTICATION_BACKENDS = ["django_auth_ldap.backend.LDAPBackend"]

Here is the Authentication Backends.

Upvotes: 0

Views: 59

Answers (0)

Related Questions