File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -31,9 +31,12 @@ def _import_group_type(group_type_name):
31
31
ldap .OPT_REFERRALS : 0
32
32
}
33
33
34
- # Set the DN and password for the NetBox service account.
35
- AUTH_LDAP_BIND_DN = environ .get ('AUTH_LDAP_BIND_DN' , '' )
36
- AUTH_LDAP_BIND_PASSWORD = _read_secret ('auth_ldap_bind_password' , environ .get ('AUTH_LDAP_BIND_PASSWORD' , '' ))
34
+ AUTH_LDAP_BIND_AS_AUTHENTICATING_USER = environ .get ('AUTH_LDAP_BIND_AS_AUTHENTICATING_USER' , 'False' ).lower () == 'true'
35
+
36
+ # Set the DN and password for the NetBox service account if needed.
37
+ if not AUTH_LDAP_BIND_AS_AUTHENTICATING_USER :
38
+ AUTH_LDAP_BIND_DN = environ .get ('AUTH_LDAP_BIND_DN' , '' )
39
+ AUTH_LDAP_BIND_PASSWORD = _read_secret ('auth_ldap_bind_password' , environ .get ('AUTH_LDAP_BIND_PASSWORD' , '' ))
37
40
38
41
# Set a string template that describes any user’s distinguished name based on the username.
39
42
AUTH_LDAP_USER_DN_TEMPLATE = environ .get ('AUTH_LDAP_USER_DN_TEMPLATE' , None )
You can’t perform that action at this time.
0 commit comments