title: django-auth-ldap - Display user information from LDAP in custom view
body: <p>I'm using django-auth-ldap with following setting because there is no default/global 'admin' user on the ldap server, its only for authenticating users and users themselves may see their user information.</p>
  
  <pre><code>AUTH_LDAP_BIND_AS_AUTHENTICATING_USER=True
  </code></pre>
  
  <p>in <code>django-ldap-debug.log</code> i get following error when (as logged in user) calling in view <code>LDAPBackend().populate_user(request.user.username)</code></p>
  
  <pre><code>search_s('uid=vchrizz,ou=Users,dc=funkfeuer,dc=at', 0, '(objectClass=*)') raised NO_SUCH_OBJECT({'desc': 'No such object'},)
  search_s('uid=vchrizz,ou=Users,dc=funkfeuer,dc=at', 0, '(objectClass=*)') returned 0 objects: 
  </code></pre>
  
  <p>only when logging in (using <code>login_required</code> from <code>django.contrib.auth.decorators</code>) it returns a user object it seems:</p>
  
  <pre><code>search_s('uid=vchrizz,ou=Users,dc=funkfeuer,dc=at', 0, '(objectClass=*)') returned 1 objects: uid=vchrizz,ou=users,dc=funkfeuer,dc=at
  </code></pre>
  
  <p>then i noticed, i need to set</p>
  
  <pre><code>AUTH_LDAP_BIND_DN
  AUTH_LDAP_BIND_PASSWORD
  </code></pre>
  
  <p>to get rid of the error, but first i dont want to specify a user with password (cause <code>bind_as_authenticating_user</code>) and second populate_user() still returns <code>NoneType</code> ...</p>
  
  <p>why? how do i get the returned user information from ldap?</p>
  
  <p>my goal is to display all ldap user information like uidNumber from the ldap-user in my custom /userinfo/ view.
  <a href="http://pastebin.com/VqGiwzFE" rel="nofollow">http://pastebin.com/VqGiwzFE</a></p>
  
  <p>thanks, chris</p>