Saml2 auth - #76
Merged
Merged
Conversation
Implement LIneA federated login (SATOSA proxy -> CILogon and Rubin IdPs)
with djangosaml2, mirroring the working setup from lsp_daiquiri and target.
SAML cannot be tested locally, so everything is gated by the
AUTH_SAML2_ENABLED env var (default False): when disabled, nothing SAML
is loaded and login falls back to the existing admin/allauth flow.
- Add guarded SAML block to base settings: backend, middleware,
SAML_CONFIG (SP endpoints, signed requests/responses, remote SATOSA
metadata), attribute mapping, and login/register URLs per IdP
- Add LineaSaml2Backend (uid-based user lookup, needs_registration and
pending-status handling, group sync preserving INTERNAL_GROUPS)
- Add saml2_template_failure view routing ACS failures to registration,
waiting-approval, and login-error pages; use session.get("idp_name")
to avoid a KeyError present in the reference implementation
- Mount saml2/ URLs and the /login/ IdP chooser page only when enabled
- Restore first_name/last_name on the User model (migration 0002) so the
SAML attribute mapping matches the reference apps
- Add djangosaml2 error templates and Bootstrap 5 IdP chooser page
- Install xmlsec1 in local and production images; mount SP certificates
as a read-only volume in production; add cert generation README and
gitignore rules for key material
- Export SAML settings to templates via django-settings-export
- Add dedicated djangosaml2 rotating log file
- Add 26 tests covering the backend, failure view routing, and the
flag-off wiring (no SAML in settings, 404 routes, allauth intact)
- Document production env vars and deployment steps in README and
SAML2_IMPLEMENTATION.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.