Skip to content

Revamped + Enhanced Shibboleth support - #842

Merged
jbau merged 5 commits into
masterfrom
jbau/shib-revamp
Sep 10, 2013
Merged

Revamped + Enhanced Shibboleth support#842
jbau merged 5 commits into
masterfrom
jbau/shib-revamp

Conversation

@jbau

@jbau jbau commented Aug 30, 2013

Copy link
Copy Markdown
  • If a shib users type in their email on the regular login page,
    redirects them to /shib-login/
  • Modify student.views.accounts_login to handle redirects
    generated by @login_required for courses that use shib for
    access control.
    Redirect those logins to /shib-login/?next=

@ormsbee @brianhw (whom I understand may be on vacation)

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.

Heh. The 2nd argument of skipUnless is supposed to be a reason string. Lucky happenstance that this worked before.

@jbau

jbau commented Sep 5, 2013

Copy link
Copy Markdown
Author

@brianhw can you take a look at this PR also?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do any of these tests work if SHIB is not enabled? (The difference is CMS versus LMS, right?)

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 they don't. These tests are assuming LMS (which also has external_auth as an INSTALLED_APP), mainly b/c they use the LMS URL schema. They don't run under CMS because external_auth is not an INSTALLED_APP.

Actually the implicit assumption is that SHIB is only used on the LMS side, even though it's in common, again because the login/reg handler functions in external_auth/views.py assume redirects to LMS student views.
I should put a comment somewhere. Probably in envs/common.py for both LMS and CMS.

Actually a broader question. Should external_auth be in common anymore? I can see student being in common for the models, even though the views are all LMS specific, but I don't know if the same can be said for external_auth.

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.

and also, the settings.MITX_FEATURES.get('AUTH_USE_SHIB') serves as a proxy for LMS vs. CMS. If there were another condition that was more directly determining LMS vs CMS tests, I might and that condition with this one.

@brianhw

brianhw commented Sep 5, 2013

Copy link
Copy Markdown
Contributor

I've made a pass, @jbau. Lots of great stuff here.

@jbau

jbau commented Sep 5, 2013

Copy link
Copy Markdown
Author

thx for your comments @brianhw
Lemme follow up as the day goes along.

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.

These changes are because I added the one log item to AUDIT_LOG in student.views.login_user. Changes this to check only the last call.

jbau added 4 commits September 6, 2013 15:36
* If a shib users type in their email on the regular login page,
  redirects them to /shib-login/
* Modify student.views.accounts_login to handle redirects
  generated by @login_required for courses that use shib for
  access control.
  Redirect those logins to /shib-login/?next=
* Fix open redirect vulnerability
* Add Logging To AUDIT_LOG : Note I had to change existing tests
  that mocked AUDIT_LOG with this
* Use external_auth.views.SHIBBOLETH_DOMAIN_PREFIX in student.views
* Add a bunch of documentation
* PEP8 / Pylint

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.

added test for flattening to ascii.

@jbau

jbau commented Sep 9, 2013

Copy link
Copy Markdown
Author

@ormsbee also, any blockers remaining? I'd like merge instead of leaving this hanging so I can move on to other priorities. (cf. our previous discussion of using the regexp versus the return value of django.urlresolvers.resolve(), where I was that the return values of resolve() didn't reveal enough about whether a URL is in a "course" context without also relying on code conventions (like course_id being a view kwarg), to the point of testing with regxep being more reliable.)

@jbau

jbau commented Sep 10, 2013

Copy link
Copy Markdown
Author

re-ran the tests and passed, so merging.

jbau added a commit that referenced this pull request Sep 10, 2013
Revamped + Enhanced Shibboleth support
@jbau
jbau merged commit f3af24f into master Sep 10, 2013
cgopalan referenced this pull request in open-craft/openedx-platform Aug 20, 2017
jfavellar90 added a commit to eduNEXT/edx-platform that referenced this pull request Aug 23, 2018
Upgrading rocket chat version to 0.2.16
kluo pushed a commit to kluo/edx-platform that referenced this pull request Dec 4, 2018
Repatriate test that was erroneously deleted.
DanielVZ96 referenced this pull request in open-craft/openedx-platform Jan 31, 2024
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.

3 participants