-
Notifications
You must be signed in to change notification settings - Fork 190
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
Feature: Custom SSO Adapter and Config Loading for Flexible SSO #502
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #502 +/- ##
==========================================
- Coverage 91.96% 91.93% -0.04%
==========================================
Files 314 315 +1
Lines 18158 18183 +25
==========================================
+ Hits 16699 16716 +17
- Misses 1459 1467 +8 ☔ View full report in Codecov by Sentry. |
Closed in favor of #513 that includes these changes. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This includes the changes from PR #501 and uses those changes to support loading SSO configurations without requiring any editing of the config files from the repository.
This also includes a customized social login adapter for
django-allauth
. The adapter includes apre_social_login()
check that look at the user's primary email address to perform the following:We could potentially check all email addresses attached to user accounts or require email addresses be verified. That may come in a later update.
If
SOCIAL_ACCOUNT_ALLOW_REGISTRATION
is enabled (set toTrue
) Ghostwriter will create a new account for the incoming user. A custompopulate_user()
sets the user's first, last, and full name fields and sets the username from the the SSO provider or the first half of the email address.The custom
is_open_for_signup()
also checks a newSOCIAL_ACCOUNT_DOMAIN_ALLOWLIST
config option. If this option is filled-in, Ghostwriter will only allow a new account to be created if the incoming user's email address matches a domain in this allowlist.