Просмотр исходного кода

Update LDAP configuration documentation

Jeremy Stretch 5 лет назад
Родитель
Сommit
dc161d9f2f
2 измененных файлов с 13 добавлено и 3 удалено
  1. 4 1
      docs/configuration/optional-settings.md
  2. 9 2
      docs/installation/5-ldap.md

+ 4 - 1
docs/configuration/optional-settings.md

@@ -386,7 +386,10 @@ NetBox can be configured to support remote user authentication by inferring user
 
 Default: `'netbox.authentication.RemoteUserBackend'`
 
-Python path to the custom [Django authentication backend](https://docs.djangoproject.com/en/stable/topics/auth/customizing/) to use for external user authentication, if not using NetBox's built-in backend. (Requires `REMOTE_AUTH_ENABLED`.)
+Python path to the custom [Django authentication backend](https://docs.djangoproject.com/en/stable/topics/auth/customizing/) to use for external user authentication. NetBox provides two built-in backends (listed below), though backends may also be provided via other packages.
+
+* `netbox.authentication.RemoteUserBackend`
+* `netbox.authentication.LDAPBackend`
 
 ---
 

+ 9 - 2
docs/installation/5-ldap.md

@@ -36,7 +36,13 @@ Once installed, add the package to `local_requirements.txt` to ensure it is re-i
 
 ## Configuration
 
-Create a file in the same directory as `configuration.py` (typically `netbox/netbox/`) named `ldap_config.py`. Define all of the parameters required below in `ldap_config.py`. Complete documentation of all `django-auth-ldap` configuration options is included in the project's [official documentation](http://django-auth-ldap.readthedocs.io/).
+First, enable the LDAP authentication backend in `configuration.py`. (Be sure to overwrite this definition if it is already set to `RemoteUserBackend`.)
+
+```python
+REMOTE_AUTH_BACKEND = 'netbox.authentication.LDAPBackend'
+```
+
+Next, create a file in the same directory as `configuration.py` (typically `netbox/netbox/`) named `ldap_config.py`. Define all of the parameters required below in `ldap_config.py`. Complete documentation of all `django-auth-ldap` configuration options is included in the project's [official documentation](http://django-auth-ldap.readthedocs.io/).
 
 ### General Server Configuration
 
@@ -145,7 +151,8 @@ logfile = "/opt/netbox/logs/django-ldap-debug.log"
 my_logger = logging.getLogger('django_auth_ldap')
 my_logger.setLevel(logging.DEBUG)
 handler = logging.handlers.RotatingFileHandler(
-   logfile, maxBytes=1024 * 500, backupCount=5)
+    logfile, maxBytes=1024 * 500, backupCount=5
+)
 my_logger.addHandler(handler)
 ```