-
Notifications
You must be signed in to change notification settings - Fork 17
CRASM-2906 Replace Cognito with custom SP SAML auth endpoints #1322
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
base: develop
Are you sure you want to change the base?
Conversation
…king was/dmz/export schema failures
…ommit union failures
…ove unused imports
cduhn17
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments
|
Known Frontend CI failures that are being addressed in other tickets: Linter issues: https://maestro.dhs.gov/jira/browse/CRASM-3437 |
| validate_json_serialization, | ||
| ) | ||
|
|
||
| logging.basicConfig(level=logging.INFO) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there is already a basicConfig in settings.py. In practice, one basicConfig is desirable in Django, if you have more than one, can cause unexpected results.
| raise RuntimeError("OKTA_SAML_METADATA_URL is not set") | ||
|
|
||
| # Fetch & parse IdP metadata | ||
| idp_data = _SamlConfig.idp_parser.parse_remote(OKTA_METADATA_URL) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Validate the URL before passing it into parse_remote. Wrap parse_remote in a try/except and log a clear error, then raise a controlled RuntimeError with a generic message, not the full stack trace or URL.
🗣 Description
Replace Cognito with custom SAML auth service provider logic to authenticate users and change primary linking user. attribute to OktaID instead of email address. See CRASM Ticket for detailed documentation for new endpoints and process breakdown.
Certificate and Metadata URL ENV vars for encrypted deployments will be added via new Django S3 logic process (CRASM-2599)
New SAML endpoints (See CRASM Ticket for detailed documentation):
New auth flowchart:
💭 Motivation and context
This removes the need for additional third party user pool configuration/management and decreases failure point surface for authentication. This will allow us to remove the third party Cognito dependency and keep authentication flow complletely in the backend with direct SAML authentication with Okta. This also allows us to control the user upsert process and primary linking keys (OktaID vs NameID/Email).
🧪 Testing
Authentication Flow from a UI perspective should not change, Locally, you will need to make sure you have the OKTA_METADATA_URL added to your local env. This URL will be shared with the team for testing.
✅ Pre-approval checklist