netbox-docker icon indicating copy to clipboard operation
netbox-docker copied to clipboard

Some REMOTE_AUTH_ settings missing

Open heapdavid opened this issue 2 years ago • 4 comments

Desired Behavior

I'd like to be able to provide all the Remote Auth settings as environment variables.

Contrast to Current Behavior

Currently only

REMOTE_AUTH_ENABLED
REMOTE_AUTH_BACKEND
REMOTE_AUTH_HEADER
REMOTE_AUTH_AUTO_CREATE_USER
REMOTE_AUTH_DEFAULT_GROUPS

are able to be pulled in from environment variables

Required Changes

Adding the ability to declare the other environment variables.

Discussion: Benefits and Drawbacks

I'm aware that I can do it currently by adding an extra file to the configuration folder but it would be good to not have to mount an extra file into the container.

Also aware that REMOTE_AUTH_DEFAULT_PERMISSIONS isn't recommended due to the complexity of the value - ref https://github.com/netbox-community/netbox-docker/issues/890 - but that shouldn't preclude the other variables from being made available.

heapdavid avatar Apr 20 '23 11:04 heapdavid

We cannot set up Azure AD (Tenants), the user ends up getting redirected to the Azure auth server with client_id=None set in the query parameters

This seems to be caused by this issue. The SOCIAL_AUTH_AZUREAD_TENANT_OAUTH2_KEY (AzureAD App ID) variable is set but seemingly not being forwarded to Netbox


could be related to #653

locomoco28 avatar May 09 '23 13:05 locomoco28

We are having this issue as well

emilyastranova avatar May 26 '23 21:05 emilyastranova

Was able to fix by adding the following to configuration.py:

SOCIAL_AUTH_AZUREAD_TENANT_OAUTH2_KEY = environ.get('SOCIAL_AUTH_AZUREAD_TENANT_OAUTH2_KEY', '')
SOCIAL_AUTH_AZUREAD_TENANT_OAUTH2_SECRET = environ.get('SOCIAL_AUTH_AZUREAD_TENANT_OAUTH2_SECRET', '')
SOCIAL_AUTH_AZUREAD_TENANT_OAUTH2_TENANT_ID = environ.get('SOCIAL_AUTH_AZUREAD_TENANT_OAUTH2_TENANT_ID', '')

Of course, you'll need to add whichever one you're using, I am using tenant.

emilyastranova avatar May 26 '23 21:05 emilyastranova

I just opened a PR that adds the missing config options #1144

hendrikbl avatar Jan 30 '24 11:01 hendrikbl