third_party_auth SAML/Shibboleth Provider Support - #8018
Conversation
|
Thanks for the pull request, @bradenmacdonald! It looks like you're a member of a company that does contract work for edX. If you're doing this work as part of a paid contract with edX, you should talk to edX about who will review this pull request. If this work is not part of a paid contract with edX, then you should ensure that there is an OSPR issue to track this work in JIRA, so that we don't lose track of your pull request. To automatically create an OSPR issue for this pull request, just visit this link: http://openedx-webhooks.herokuapp.com/github/process_pr?number=8018&repo=edx%2Fedx-platform |
d62855a to
925904e
Compare
|
@cpennington Can you please review this? Build failure is due to Jenkins boxes lacking the new ubuntu package dependencies. @mollydb and @e0d can you please review the new requirement I've included in this PR: python-saml + two ubuntu packages it requires (which we may be able to remove as python-saml's dependencies are likely to change in a future major release). Note I'm using a forked/patched version for now, but if the patches are accepted upstream we'll be able to use a pypi release. CC @antoviaque |
|
👍 I reviewed this code already in #7893 and only had a quick look at the changes since then – looks good! |
|
The apt requirements change LGTM, we'll still need to merge the configuration change, but need to keep in synch for those not using ansible. |
|
Thanks for the pull request, @bradenmacdonald! It looks like you're a member of a company that does contract work for edX. If you're doing this work as part of a paid contract with edX, you should talk to edX about who will review this pull request. If this work is not part of a paid contract with edX, then you should ensure that there is an OSPR issue to track this work in JIRA, so that we don't lose track of your pull request. To automatically create an OSPR issue for this pull request, just visit this link: http://openedx-webhooks.herokuapp.com/github/process_pr?repo=edx%2Fedx-platform&number=8018 |
1 similar comment
|
Thanks for the pull request, @bradenmacdonald! It looks like you're a member of a company that does contract work for edX. If you're doing this work as part of a paid contract with edX, you should talk to edX about who will review this pull request. If this work is not part of a paid contract with edX, then you should ensure that there is an OSPR issue to track this work in JIRA, so that we don't lose track of your pull request. To automatically create an OSPR issue for this pull request, just visit this link: http://openedx-webhooks.herokuapp.com/github/process_pr?repo=edx%2Fedx-platform&number=8018 |
|
@cpennington Do you have an idea when you will be able to review this? Ideally it would be good if @bradenmacdonald could work on the review comments this week, but let me know what is possible - there is a lot of code and depenencies on this project, so it's hard to keep moving forward with the rest of the requirements while this is still in review. |
|
@antoviaque @bradenmacdonald: I've been reviewing it, but haven't yet had any comments. I was just taking a look at the python-social-auth code (I've already reviewed the python-saml PRs). |
There was a problem hiding this comment.
if cls.BACKEND_CLASS.name != pipeline['backend'], should this return False, or None (as is implicitly being done now?)
There was a problem hiding this comment.
Good catch, it should return False for consistency.
|
This has a lot of changes to the effect of |
|
Those are all broken out separately as the first commit 925904e - they're required API changes for compatibility with the updated version of python-social-auth (0.2.7) I tried to keep the commits fairly clear and separate to better document the changes I made. |
|
Ah, excellent. I hadn't looked at each commit individually. Done w/ my review pass. A few very minor problems, but 👍 once those are resolved. |
|
Thanks @cpennington! Should I merge https://github.com/edx/configuration/pull/2002 now, or keep it pending until we eventually merge this whole feature branch? It would be nice to have working Jenkins tests on this feature branch in the meantime (I'm assuming that configuration PR is what will add the prereqs Jenkins needs) |
|
Yeah, I think merging now makes sense. |
|
@cpennington I've addressed your minor comments in bbb0ccb. I'm going to rebase/squash now and then once I check that the tests are passing (at least locally) post-rebase, I'll merge this to the feature branch. I'll also open a new PR for tracking the feature branch status, all the component PRs, and any notes that will be needed when we merge the feature branch. |
bbb0ccb to
3ff710c
Compare
|
Ran all tests locally and they're all passing. |
third_party_auth SAML/Shibboleth Provider Support
|
@bradenmacdonald, thanks for pushing this third-party auth Shibboleth update out so that everyone can use it. I used the old version of Shibboleth SP and Apache with @johncox-google help here. Clemson University has been using this thirdy-party auth with Shibboleth since beginning of last Fall 2014 but I never pushed my changes to everyone. I'm really interested in the 2. Support many Shibboleth institutional login options that you mentioned in your technical spec |
|
@ztraboo Interesting, thanks for sharing. The new implementation does not require Shibboleth SP or Apache, so it lets you have a simpler stack. The "Support many Shibboleth institutional login options" feature is already in master and will be in the Cypress release. It was implemented in #8603. |
|
@bradenmacdonald, thanks for sharing. That's great news. Where are the configuration settings for the OAuth2 (Google, LinkedIn) providers set as previously noted in the edx third_party_auth page? /edx/app/edxapp/lms.auth.json "THIRD_PARTY_AUTH": {
"Google": {
"SOCIAL_AUTH_GOOGLE_OAUTH2_KEY": "google_key",
"SOCIAL_AUTH_GOOGLE_OAUTH2_SECRET": "google_secret"
},
"LinkedIn": {
"SOCIAL_AUTH_LINKEDIN_OAUTH2_KEY": "linkedin_key",
"SOCIAL_AUTH_LINKEDIN_OAUTH2_SECRET": "linkedin_secret"
}
}Any idea why I would be reinitializing the social_auth_usersocialauth database table? I think it has something to do with social.backends. Did you run into a migration issue like this? |
|
@ztraboo The configuration is now stored in the database and is edited via the Django admin. Your OAuth2 settings will be migrated automatically. For details on that and the migration issue you've run into, see: |
|
@bradenmacdonald Thank you for the support. You mentioned that "The new implementation does not require Shibboleth SP or Apache..." so we don't need to setup Shibboleth SP anymore? You mentioned in your technical document that "IdP and SP must register with each other by exchanging XML metadata, which includes the public key of each service/provider". I remember us having to do that step. I read up to the Implementation Plan in that document so let me know if you say anything there about setup. I used these edx Shibboleth setup instructions to get it working previously. Can you update these notes? |
|
@ztraboo That's correct. You don't need to run the "Shibboleth SP" software, since edx-platform itself can now act as the SP. The Docs team is working on new documentation for Shibboleth, and it should be included with the Cypress release. Once it's ready we should update that wiki page. In the meantime, OPS-820 has reasonably complete instructions and is the best I can offer. |
|
@bradenmacdonald Here are some configuration settings that we did to have ansible install apache and shibboleth. I'm guessing that we still need to keep these around for the course Shibboleth restriction in the Studio > Advanced Setting > enrollment_domain setting (e.g. shib:<your_idp>). It looks like your technical document mentioned 4. Remove the legacy Shibboleth implementation. Has this been implemented yet? Configuration Changes playbooks/roles/apache/templates/lms.j2
|
|
@ztraboo Please email me so we can continue this conversation and I can send you those instructions. No need to request access to JIRA. For the record:
|
|
@ztraboo @bradenmacdonald If there is a conversation/support on this, it would be worth having it publicly on the openedx-ops mailing list, so it can be useful to others in the community. |
|
For those interested: All of the new SSO features will be thoroughly documented in the documentation update that accompanies the upcoming Cypress release. In the meantime, I have posted the information required to test out the new SSO/Shibboleth functionality at https://openedx.atlassian.net/wiki/display/OpenOPS/New+Shibboleth+Configuration |


Description
This is the first part of implementing the new Shibboleth SSO support integrated into third_party_auth (TPA). See the technical spec for a lot more background and discussion.
This PR will merge the new code to a feature branch,
feature/shibboleth-tpaChanges in this PR
This first PR does the following:
third_party_auth(TPA) to use the latest version of python-social-auth (this was a non-trivial upgrade)New Requirement
This introduces one new requirement: python-saml, which also [currently] requires two new debian packages not installed on most edX instances:
libxmlsec1-devandswig.Dependencies
Sandbox
Internal Code Review PR: https://github.com/edx/edx-platform/pull/7893
Upgrade Issue
When merged, this PR does cause a problem for existing installations:
python-social-authat one point converted fromsyncdbto south/django migrations, and bumping the version ofpython-social-auththat we use will result in this error next timepaver update_dbis run:To fix this (on devstack), the user must manually run this command:
Unfortunately, I'm not aware of any way to avoid this issue other than this manual fix. New installs are not affected.
Testing Instructions:
Go to the sandbox link above and login via TestShib. Try registering then linking and unlinking TestShib accounts. If it doesn't work, it may be necessary to re-upload the metadata to TestShib's "Register" page. A link to the metadata is above.
To test locally, see https://github.com/edx/edx-platform/pull/7893
Not included:
The following will be coming in future PRs against this feature branch: