OAuth for REST API access? #18250
Unanswered
indy-independence
asked this question in
Help Wanted!
Replies: 1 comment
-
I got a little bit further by installing another lib to handle auth for django rest framework:
/opt/netbox/venv/lib/python3.12/site-packages/drf_social_oauth2/backends.py
Now I get {"detail":"You do not have permission to perform this action."} so I need some way to map something in access token to permissions in netbox I guess |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is it possible to authenticate to the netbox REST API via the remote authentication backends? Now I have authentication setup with:
REMOTE_AUTH_BACKEND = 'social_core.backends.keycloak.KeycloakOAuth2'
Which works great for the normal WebUI login. But asking every user to generate an API key on their own is not great for my usecase, and I don't think the provisioning of API key via API works either because it seems to assume you want to send in username+password to authenticate
I did a quick test and just added another backend under settings.py under the Django REST framework stuff
But feels like I probably need to configure something more? With only that change I get a little bit further when trying with Authorization: Bearer header, it gives this error back: "AttributeError KeycloakOAuth2 object has no attribute authenticate_header"
Beta Was this translation helpful? Give feedback.
All reactions