Guest User

Untitled

a guest
Nov 7th, 2018
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. import ldap
  2. from django_auth_ldap.config import LDAPSearch
  3.  
  4. AUTHENTICATION_BACKENDS = [
  5. 'django_auth_ldap.backend.LDAPBackend',
  6. ]
  7.  
  8. AUTH_LDAP_START_TLS = False
  9. AUTH_LDAP_ALWAYS_UPDATE_USER = False
  10. AUTH_LDAP_SERVER_URI = 'ldap://ip_address:389'
  11. AUTH_LDAP_BIND_DN = ''
  12. AUTH_LDAP_BIND_PASSWORD = ''
  13. AUTH_LDAP_USER_SEARCH = LDAPSearch('DC=example,DC=com', ldap.SCOPE_SUBTREE, '(sAMAccountName=%(user)s)')
  14. AUTH_LDAP_CONNECTION_OPTIONS = {
  15. ldap.OPT_REFERRALS: 0,
  16. }
  17.  
  18. ERROR search_s('DC=example,DC=com', 2, '(sAMAccountName=user)') raised OPERATIONS_ERROR({'desc': 'Operations error', 'info': '00000000: LdapErr: DSID-0C090627, comment: In order to perform this operation a successful bind must be completed on the connection., data 0, vece'})
  19. DEBUG search_s('DC=example,DC=com', 2, '(sAMAccountName=%(user)s)') returned 0 objects:
  20. DEBUG Authentication failed for user: failed to map the username to a DN.
Add Comment
Please, Sign In to add comment