Skip to content

[SE-3816] Adds waffle switch to enable third party auth email association - #304

Merged
nizarmah merged 3 commits into
opencraft-release/juniper.3from
nizar/tpa_associate_by_email_waffle_switch_backport
Dec 28, 2020
Merged

[SE-3816] Adds waffle switch to enable third party auth email association#304
nizarmah merged 3 commits into
opencraft-release/juniper.3from
nizar/tpa_associate_by_email_waffle_switch_backport

Conversation

@nizarmah

@nizarmah nizarmah commented Dec 23, 2020

Copy link
Copy Markdown

Currently, in the edX platform, if you try to login with an SSO account using the login form, a username is generated for you based on the email that is used with the SSO provider.

The username is generated using the pipeline third_party_auth.pipeline.get_username.

If the username already exists in the platform, you run into a small conflict which sends you back to the login form and requests the following:
image
It basically requests that you link your edX account and your SSO account.

However, sometimes we would want the edX account and SSO account to be associated by email. There's already a special pipeline available in the platform for that, third_party_auth.pipeline.associate_by_email_if_login_api. Sadly, however, it is only available for a certain entry method of authentication, called login_api.

So in order to start associating the edX account and SSO account by email, this pull request adds a waffle switch.

JIRA tickets: SE-3816

Upstream Pull Request: https://github.com/edx/edx-platform/pull/25935

Testing instructions:

Reviewers

@nizarmah
nizarmah force-pushed the nizar/tpa_associate_by_email_waffle_switch_backport branch from 4d751cb to d3a4f1b Compare December 23, 2020 12:53
@nizarmah
nizarmah requested a review from 0x29a December 24, 2020 11:29
@nizarmah nizarmah self-assigned this Dec 24, 2020
@nizarmah
nizarmah force-pushed the nizar/tpa_associate_by_email_waffle_switch_backport branch 3 times, most recently from e4a21bb to ee111ae Compare December 26, 2020 03:13
(cherry picked from commit 914410a47b50933e5a92e2e77e0dbc85ff405cce)
@nizarmah
nizarmah force-pushed the nizar/tpa_associate_by_email_waffle_switch_backport branch from ee111ae to ff8a593 Compare December 26, 2020 03:23
(cherry picked from commit 2f727bab3d27d52907a119e2f6366247c79c30af)
…ne method

(cherry picked from commit 03a6882f79fec104aae6a2a2c889e0452638d400)
@gabor-boros

Copy link
Copy Markdown

👍 🎉

  • I tested what's in the test instructions
  • I read through the code
  • NA I checked for accessibility issues
  • NA Includes documentation
  • NA I made sure any change in configuration variables is reflected in the corresponding client's configuration-secure repository.


@partial.partial
def associate_by_email_if_login_api(auth_entry, backend, details, user, current_partial=None, *args, **kwargs):
def associate_user_by_email(auth_entry, backend, details, user, current_partial=None, *args, **kwargs):

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we want to apply edx@0219edd as well?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, that change is specific to Python 3.8

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, since we will upgrade python when we upgrade edx-platform (I guess), this is not an issue then.

@gabor-boros gabor-boros left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see the comment about the "missing" commit

@nizarmah
nizarmah merged commit eaf73df into opencraft-release/juniper.3 Dec 28, 2020
@nizarmah
nizarmah deleted the nizar/tpa_associate_by_email_waffle_switch_backport branch December 28, 2020 18:28
nizarmah added a commit that referenced this pull request Jan 2, 2021
nizarmah pushed a commit that referenced this pull request Dec 14, 2021
from the edx-sga release notes at https://github.com/mitodl/edx-sga/blob/master/RELEASE.rst

- Update license classifier (#312)
- Update license text to match pypi's acceptable list (#310)
- Upgrade django to 3.2 LTS (#304)
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.

2 participants