REMOTE_AUTH_DEFAULT_GROUPS not being applied for django_auth method #7980

Closed
opened 2025-12-29 20:30:48 +01:00 by adam · 2 comments
Owner

Originally created by @andyb2000 on GitHub (May 2, 2023).

NetBox version

v3.4.6

Python version

3.10

Steps to Reproduce

Create GROUP "staff-users" and setup permissions.

Add a remote_auth_backend (I'm using django auth for tacacs):

REMOTE_AUTH_BACKEND = 'django_auth_tacacs.django.TACACSPlusAuthenticationBackend'
REMOTE_AUTH_AUTO_CREATE_USER = True
REMOTE_AUTH_DEFAULT_GROUPS = ['staff-users']
REMOTE_AUTH_GROUP_SYNC_ENABLED = False

Check and ensure you can login using the remote auth, login using a user that doesn't exist in the netbox user database.

Expected Behavior

The user will be authenticated/logged in.
The user will be created as we have set "REMOTE_AUTH_AUTO_CREATE_USER", the users group should be assigned to "staff-users".

Observed Behavior

At the moment the user is created, but not assigned to the group, therefore they don't inherit the permissions.

Logging does not throw out any errors/failures to assign to groups (debug logging enabled)

May 2 10:31:27 srvr-bNetBox: level=DEBUG,logger=netbox.config,msg=No previous configuration found in database; proceeding with default values
May 2 10:31:27 srvr-bNetBox: level=DEBUG,logger=netbox.config,msg=Initialized configuration
May 2 10:31:27 srvr-b NetBox: level=DEBUG,logger=django_auth_tacacs.django,msg=Created TACACS+ user andy.brown
May 2 10:31:27 srvr-bNetBox: level=DEBUG,logger=netbox.auth.login,msg=Login form validation was successful
May 2 10:31:27 srvr-bNetBox: level=INFO,logger=netbox.auth.login,msg=User andy.brown successfully authenticated
May 2 10:31:27 srvr-bNetBox: level=DEBUG,logger=netbox.auth.login,msg=Redirecting user to /
May 2 10:31:27 srvr-bNetBox: level=DEBUG,logger=netbox.config,msg=Cleared configuration
May 2 10:31:27 srvr-bNetBox: level=DEBUG,logger=netbox.config,msg=No previous configuration found in database; proceeding with default values
May 2 10:31:27 srvr-bNetBox: level=DEBUG,logger=netbox.config,msg=Initialized configuration
May 2 10:31:27 srvr-bNetBox: level=DEBUG,logger=netbox.config,msg=Cleared configuration

Originally created by @andyb2000 on GitHub (May 2, 2023). ### NetBox version v3.4.6 ### Python version 3.10 ### Steps to Reproduce Create GROUP "staff-users" and setup permissions. Add a remote_auth_backend (I'm using django auth for tacacs): REMOTE_AUTH_BACKEND = 'django_auth_tacacs.django.TACACSPlusAuthenticationBackend' REMOTE_AUTH_AUTO_CREATE_USER = True REMOTE_AUTH_DEFAULT_GROUPS = ['staff-users'] REMOTE_AUTH_GROUP_SYNC_ENABLED = False Check and ensure you can login using the remote auth, login using a user that doesn't exist in the netbox user database. ### Expected Behavior The user will be authenticated/logged in. The user will be created as we have set "REMOTE_AUTH_AUTO_CREATE_USER", the users group should be assigned to "staff-users". ### Observed Behavior At the moment the user is created, but not assigned to the group, therefore they don't inherit the permissions. Logging does not throw out any errors/failures to assign to groups (debug logging enabled) May 2 10:31:27 srvr-bNetBox: level=DEBUG,logger=netbox.config,msg=No previous configuration found in database; proceeding with default values May 2 10:31:27 srvr-bNetBox: level=DEBUG,logger=netbox.config,msg=Initialized configuration May 2 10:31:27 srvr-b NetBox: level=DEBUG,logger=django_auth_tacacs.django,msg=Created TACACS+ user andy.brown May 2 10:31:27 srvr-bNetBox: level=DEBUG,logger=netbox.auth.login,msg=Login form validation was successful May 2 10:31:27 srvr-bNetBox: level=INFO,logger=netbox.auth.login,msg=User andy.brown successfully authenticated May 2 10:31:27 srvr-bNetBox: level=DEBUG,logger=netbox.auth.login,msg=Redirecting user to / May 2 10:31:27 srvr-bNetBox: level=DEBUG,logger=netbox.config,msg=Cleared configuration May 2 10:31:27 srvr-bNetBox: level=DEBUG,logger=netbox.config,msg=No previous configuration found in database; proceeding with default values May 2 10:31:27 srvr-bNetBox: level=DEBUG,logger=netbox.config,msg=Initialized configuration May 2 10:31:27 srvr-bNetBox: level=DEBUG,logger=netbox.config,msg=Cleared configuration
adam closed this issue 2025-12-29 20:30:48 +01:00
Author
Owner

@stuntguy3000 commented on GitHub (May 9, 2023):

What's a good way to resolve this - add this module as a dependency and add an internal TACACS Auth Backend w/ Groups?

@stuntguy3000 commented on GitHub (May 9, 2023): What's a good way to resolve this - add this module as a dependency and add an internal TACACS Auth Backend w/ Groups?
Author
Owner

@jeremystretch commented on GitHub (Sep 25, 2023):

TACACSPlusAuthenticationBackend is not a NetBox-specific authentication backend. NetBox's authentication configuration options pertain only to backends which inherit from our RemoteUserBackend class. You'll need to consult the django_auth_tacacs documentation for instructions on enabling default group assignment.

@jeremystretch commented on GitHub (Sep 25, 2023): TACACSPlusAuthenticationBackend is not a NetBox-specific authentication backend. NetBox's authentication configuration options pertain only to backends which inherit from our `RemoteUserBackend` class. You'll need to consult the `django_auth_tacacs` documentation for instructions on enabling default group assignment.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#7980