Skip to content
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

feat: redirect to custom URL when third-party auth account is unlinked #4

Conversation

ArturGaspar
Copy link
Member

Description

Backport of openedx#1078

Allow redirecting to a custom URL when signing in via third-party auth when the account is not linked.

How Has This Been Tested?

  1. Set the following settings in the LMS:
    • ENABLE_MFE_CONFIG_API = True
    • ENABLE_COMBINED_LOGIN_REGISTRATION = True
    • ENABLE_THIRD_PARTY_AUTH = True
    • AUTHN_MICROFRONTEND_URL = 'http://localhost:1999'
    • MFE_CONFIG = {"TPA_UNLINKED_ACCOUNT_PROVISION_URL": "http://example.com"}
  2. Set 'ENABLE_THIRD_PARTY_AUTH': True and 'ENABLE_AUTHN_MICROFRONTEND': True in FEATURES dict in LMS settings (edx-platform/lms/envs/common.py).
  3. Create a dummy backend Oauth2 provider at http://localhost:18000/admin/third_party_auth/oauth2providerconfig/ and enable its "Visible" setting.
  4. Set MFE_CONFIG_API_URL='http://localhost:18000/api/mfe_config/v1' in frontend-app-authn (e.g. in .env.development).
  5. Go to http://localhost:1999/login.
  6. Sign in with the "Dummy" provider.
  7. See that you are redirected to example.com

The login page will briefly show before redirect but I see no way to prevent this as the request to http://localhost:18000/api/mfe_context is made asynchronously and we don't know the third-party auth context until it is made, but the login page can be rendered before that.

Merge Checklist

  • If your update includes visual changes, have they been reviewed by a designer? Send them a link to the Sandbox, if applicable.
  • Is there adequate test coverage for your changes?

Post-merge Checklist

  • Deploy the changes to prod after verifying on stage or ask @openedx/vanguards to do it.
  • 🎉 🙌 Celebrate! Thanks for your contribution.

@ArturGaspar ArturGaspar force-pushed the artur/redirect-on-tpa-unlinked-palm-backport branch from 08563c3 to 4b8e50f Compare October 25, 2023 06:45
@codecov
Copy link

codecov bot commented Oct 25, 2023

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant