API user impersonation #7178
Replies: 2 comments 3 replies
-
I'm pretty sure that API requests can be authenticated either by a token or as a normally logged-in user - since the GUI makes a few API calls via AJAX, e.g. for populating drop-down selectors, and this doesn't allocate tokens to the user. Therefore, I think that if you stick Netbox behind a HTTP reverse proxy, which implements your OpenID (or whatever) authentication, and use Netbox "external" authentication, it should work - for controlling access both to GUI and API, and hence associating API calls with the real user. I have Netbox set up that way for normal GUI access (with Apache2 + mod_auth_openidc). At the moment I don't force the API clients to fetch OpenID identity tokens; I have a bypass setup so that if you present an |
Beta Was this translation helpful? Give feedback.
-
I do the authorization based on local users/groups in Netbox. I don't know if you can do LDAP group authorization when using external authentication, nor whether you can map any claims in HTTP headers to groups. I have no idea about how hard it would be to integrate django-auth-adfs. Personally I'd prefer something standard (i.e. OpenID Connect) rather than Microsoft proprietary; if necessary via some middle box like Keycloak. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey,
So we’re in the process of adopting netbox, and while the UI will be used directly by logged in users, our plan is to do most CRUD via a wrap-around system which manages assets in netbox, but also updates dns, dhcp, aci, config, nsx, monitoring tools etc etc. (looking to use #ns1 dns/dhcp btw)
We’ve been using the ldap module for netbox and a single token for the API, but ideally the changes made via the API would be done so they are recorded as done by the logged in user (via oauth2/Azure AD) in the wrapper system.
In theory this should be possible if Oauth is supported for the API - but I’m not sure it is, even though the netbox UI might support users logging in?
Can someone clarify the options if they exist?
thanks
Beta Was this translation helpful? Give feedback.
All reactions