-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add tenant selection to Azure AD extenal auth #37
Conversation
Thanks! Looks fine to me for now! Would you mind updating the wiki for these settings? I'm not quite using Azure AD myself yet. |
I was looking for updating the Wiki but looks like I cannot fork and PR like a normal repo https://docs.github.com/en/communities/documenting-your-project-with-wikis/about-wikis I can send over a snippet to you, in some way... |
A snippet is fine. Can you post one in the comments here? I do not use tenant selection with AzureAD so anything short and descriptive about how to use it would be very helpful to others. Thanks! |
it's very simple, the basic scenario uses an implicit tenant for AzureAD, while in this one, the only difference is that you need to specify one. I would go with just an example like this: If your app is linked to a specific tenant, see the below for a configuration example: # host_vars.yaml
# Azure AD
netbox_remote_auth:
enabled: True
backend: 'social_core.backends.azuread.AzureADTenantOAuth2'
azuread_oauth2:
key: 6eabe82b-731e-40f0-bc40-80798f5e1021 # APPLICATION_ID
secret: X_X7Q~6Cp4XX1ZHVHGxqoM2w.q1prQ # SECRET_VALUE
tenant: dfa9dfa2-6ag3-4ddf-9v1c-9622b54ded7a # TENANT ID
# Optionally force the use of an HTTPS redirect URI
# (see the official documentation for more information about this option)
# social_auth_redirect_is_https: True This link will show how to find your tenant ID |
Hello.
I was able to add some lines in the configuration.py to enable tenant definition and selection.
Netbox requires to specify a different backend for tenants, I thought about linking my
if
to that one.This is working already in my netbox-staging environment with our AzureAD tenancy.
Let me know if this could add some value to your role and feel free to ask for changes to align the code to your styling/preferences.
Best!