Skip to content
This repository was archived by the owner on Nov 12, 2023. It is now read-only.

[SE-1199] Fix username hints for SSO - #7

Closed
pkulkark wants to merge 2 commits into
masterfrom
pooja/fix-username-hints-with-SSO
Closed

[SE-1199] Fix username hints for SSO#7
pkulkark wants to merge 2 commits into
masterfrom
pooja/fix-username-hints-with-SSO

Conversation

@pkulkark

Copy link
Copy Markdown

This PR fixes the issue of the username hints not working for SSO - Google, FB, SAML.
The fix essentially disables calling the default clean username method which filters out non-ascii characters.

Testing Instructions:

  1. Go to https://courses.campus-dev.opencraft.hosting/register?next=/dashboard and login with either MOE SSO/FB/Google credentials.
  2. Verify that the username field being auto-filled is correct.

Reviewers:
@pomegranited

@pomegranited pomegranited 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.

Excellent work finding this clean fix, @pkulkark ! Since we do need to upstream this, I've made a suggestion which I think will make that more doable, and so we'll need a test added to test_settings to cover it.

But it works perfectly, so will approve once that's in and working.

Thank you!

django_settings.SOCIAL_AUTH_AZUREAD_OAUTH2_AUTH_EXTRA_ARGUMENTS = _SOCIAL_AUTH_AZUREAD_OAUTH2_AUTH_EXTRA_ARGUMENTS

# Avoid default username check to allow non-ascii characters
django_settings.SOCIAL_AUTH_CLEAN_USERNAMES = False

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

To make this upstreamable, I suggest linking this setting to the existing settings.FEATURES['ENABLE_UNICODE_USERNAME'] which we already have enabled on Campus's servers. e.g.

django_settings.SOCIAL_AUTH_CLEAN_USERNAMES = not settings.FEATURES.get("ENABLE_UNICODE_USERNAME")

@pkulkark

Copy link
Copy Markdown
Author

@pomegranited Thanks a lot! I didn't know about that feature. I've made the required changes. Let me know if i've missed anything.

@pkulkark
pkulkark changed the base branch from master to opencraft-release/ginkgo.2-campus June 25, 2019 02:17
@pkulkark
pkulkark changed the base branch from opencraft-release/ginkgo.2-campus to master June 25, 2019 02:18
@pkulkark

Copy link
Copy Markdown
Author

Closing this in favor of #8

@pkulkark pkulkark closed this Jun 25, 2019
@pkulkark
pkulkark deleted the pooja/fix-username-hints-with-SSO branch June 25, 2019 03:04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants