netbox/docs/administration/authentication
Jeremy Stretch a4ade2e7ae
Fixes #23112: Initiate SSO logins via a script-driven navigation (#23177)
Rendering the SSO buttons as POST forms (#23042) made every SSO login a form
submission which NetBox answers with a redirect to the identity provider.
Chromium-based browsers evaluate the CSP form-action directive against every hop
in a form submission's redirect chain, so a deployment which serves NetBox with
`form-action 'self'` blocks that redirect and the button silently does nothing.

Add SocialAuthBeginView, which wraps python-social-auth's begin view and returns
the identity provider's URL as JSON to clients which request it. The login page
now submits the form via fetch() and assigns window.location, which form-action
does not govern. The upstream view is reused as-is, so CSRF protection, the
callback URL, and the session state recorded for the identity provider are
unchanged; clients which do not request JSON (a browser without JavaScript, or a
backend which renders an HTML form rather than redirecting) receive the
unmodified response as before.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-15 13:00:11 -04:00
..
google.md Add instructions for authenticating using Google oauth2 (#17527) 2024-10-18 09:36:29 -04:00
microsoft-entra-id.md Update Grammar 2025-09-07 08:35:59 -04:00
okta.md Merge branch 'develop' into feature 2024-02-05 14:38:26 -05:00
overview.md Fixes #23112: Initiate SSO logins via a script-driven navigation (#23177) 2026-09-15 13:00:11 -04:00