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鈥檒l 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

Open
wants to merge 1 commit into
base: opencraft-release/palm.1
Choose a base branch
from

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 merged to your default branch, Codecov will compare your coverage reports and display the results in this comment.

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
1 participant