diff options
author | Mikaël Ates <mates@entrouvert.com> | 2014-12-09 16:01:51 (GMT) |
---|---|---|
committer | Mikaël Ates <mates@entrouvert.com> | 2014-12-09 16:02:00 (GMT) |
commit | 9f377351a9ee6269187f93fccd6fdc8c8228a90b (patch) | |
tree | 7ff24f4aef3df6cbac75dbd02f7800213b35cd62 | |
parent | 92edfa2d54680fe503846382088f4d6458bcdc71 (diff) | |
download | authentic-9f377351a9ee6269187f93fccd6fdc8c8228a90b.zip authentic-9f377351a9ee6269187f93fccd6fdc8c8228a90b.tar.gz authentic-9f377351a9ee6269187f93fccd6fdc8c8228a90b.tar.bz2 |
documentation: fix block of code displays in quick ldap backend file.
-rw-r--r-- | doc/quick_ldap_backend.rst | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/doc/quick_ldap_backend.rst b/doc/quick_ldap_backend.rst index a96b3fa..1185608 100644 --- a/doc/quick_ldap_backend.rst +++ b/doc/quick_ldap_backend.rst @@ -21,20 +21,20 @@ How to authenticate users against an LDAP server with anonymous binding ? 2. Configure your local_settings.py file for authenticating against LDAP. The next lines must be added:: - AUTHENTICATION_BACKENDS += ( 'django_auth_ldap.backend.LDAPBackend', ) + AUTHENTICATION_BACKENDS += ( 'django_auth_ldap.backend.LDAPBackend', ) - import ldap - from django_auth_ldap.config import LDAPSearch + import ldap + from django_auth_ldap.config import LDAPSearch - # Here put the LDAP URL of your server - AUTH_LDAP_SERVER_URI = 'ldap://ldap.example.com' - # Let the bind DN and bind password blank for anonymous binding - AUTH_LDAP_BIND_DN = "" - AUTH_LDAP_BIND_PASSWORD = "" - # Lookup user under the branch o=base and by mathcing their uid against the - # received login name - AUTH_LDAP_USER_SEARCH = LDAPSearch("o=base", - ldap.SCOPE_SUBTREE, "(uid=%(user)s)") + # Here put the LDAP URL of your server + AUTH_LDAP_SERVER_URI = 'ldap://ldap.example.com' + # Let the bind DN and bind password blank for anonymous binding + AUTH_LDAP_BIND_DN = "" + AUTH_LDAP_BIND_PASSWORD = "" + # Lookup user under the branch o=base and by mathcing their uid against the + # received login name + AUTH_LDAP_USER_SEARCH = LDAPSearch("o=base", + ldap.SCOPE_SUBTREE, "(uid=%(user)s)") How to allow members of an LDAP group to manage Authentic ? ----------------------------------------------------------- @@ -47,13 +47,13 @@ How to allow members of an LDAP group to manage Authentic ? 3. Add the following lines:: - from django_auth_ldap.config import GroupOfNamesType - AUTH_LDAP_GROUP_TYPE = GroupOfNamesType() - AUTH_LDAP_GROUP_SEARCH = LDAPSearch("o=mycompany", + from django_auth_ldap.config import GroupOfNamesType + AUTH_LDAP_GROUP_TYPE = GroupOfNamesType() + AUTH_LDAP_GROUP_SEARCH = LDAPSearch("o=mycompany", ldap.SCOPE_SUBTREE, "(objectClass=groupOfNames)") - AUTH_LDAP_USER_FLAGS_BY_GROUP = { + AUTH_LDAP_USER_FLAGS_BY_GROUP = { "is_staff": "cn=admin,o=mycompany" - } + } For an objectClass of groupOfUniqueNames you would change the string GroupOfNamesType to GroupOfUniqueNamesType and grouOfNames to |