edx-platform
edx-platform copied to clipboard
[WIP] feat: Added custom auth endpoint for IDP initiated SSO
This pull request introduces a new view to support IdP-initiated SSO login flows, specifically designed for Auth0's IdP-initiated SAML sign-on to OIDC applications. It adds a robust, well-tested endpoint for handling these SSO flows, updates the URL configuration to expose the new view, and includes comprehensive tests to ensure correct behavior.
IdP-Initiated SSO Support:
- Added a new
IdpInitiatedSsoViewinidp_initiated_sso.pyto handle IdP-initiated SSO login requests, supporting Auth0's SAML-to-OIDC pattern. This view processes requests with aconnectionparameter, determines the appropriate OAuth/OIDC provider, and redirects to the provider's login URL with the correct parameters. - Registered the new view in
urls.pyat the endpoint/auth/idp-sso/login, making it accessible asidp_initiated_sso_login.
Testing:
- Added comprehensive tests in
test_idp_initiated_sso.pyto cover all major behaviors of the new view, including handling of valid and invalid parameters, provider selection logic, error handling, and parameter propagation.