jeremyschulman / netbox-plugin-auth-saml2

Netbox plugin for SSO using SAML2
119 stars 21 forks source link

Error: NameError: name 'REMOTE_AUTH_BACKEND' is not defined #47

Closed kaon1 closed 2 years ago

kaon1 commented 2 years ago

Seeing this error on the latest version of Netbox 3.0.X.

I tried pinning pysaml2 6.5.0 as mentioned in another thread.

Running python3 version 3.7.12

My REMOTE_AUTH_BACKEND value is defined, not sure why I'm seeing the error.

# Remote authentication support
REMOTE_AUTH_ENABLED = True
REMOTE_AUTH_BACKEND = 'utilities.auth_backends.RemoteUserBackend'
REMOTE_AUTH_HEADER = 'HTTP_REMOTE_USER'
REMOTE_AUTH_AUTO_CREATE_USER = True
REMOTE_AUTH_DEFAULT_GROUPS = []
REMOTE_AUTH_DEFAULT_PERMISSIONS = {}
kaon1 commented 2 years ago

Think I figured it out sorry for the noise

mp-strachan commented 2 years ago

What was your solution @kaon1? I'm having this same problem and can't seem to resolve it.

kaon1 commented 2 years ago
# Remote authentication support
REMOTE_AUTH_ENABLED = True
REMOTE_AUTH_BACKEND = 'django3_saml2_nbplugin.backends.SAML2CustomAttrUserBackend'
REMOTE_AUTH_AUTO_CREATE_USER = True
REMOTE_AUTH_DEFAULT_GROUPS = []
REMOTE_AUTH_DEFAULT_PERMISSIONS = {}

The above config works for me, my original issue had a simple syntax error in the config. Make sure these two plugins are installed in your python env:

netbox-plugin-auth-saml2
django3_auth_saml2