Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
0ba1828f
Commit
0ba1828f
authored
Dec 05, 2014
by
Jason Bau
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix shib code to handle course.enrollment_domain=None
parent
fd0754b4
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
4 deletions
+12
-4
common/djangoapps/external_auth/tests/test_shib.py
+2
-2
common/djangoapps/external_auth/views.py
+10
-2
No files found.
common/djangoapps/external_auth/tests/test_shib.py
View file @
0ba1828f
...
...
@@ -376,7 +376,7 @@ class ShibSPTest(ModuleStoreTestCase):
self
.
assertEqual
(
profile
.
name
,
identity
.
get
(
'displayName'
)
.
decode
(
'utf-8'
))
@unittest.skipUnless
(
settings
.
FEATURES
.
get
(
'AUTH_USE_SHIB'
),
"AUTH_USE_SHIB not set"
)
@data
(
""
,
"shib:https://idp.stanford.edu/"
)
@data
(
None
,
""
,
"shib:https://idp.stanford.edu/"
)
def
test_course_specific_login_and_reg
(
self
,
domain
):
"""
Tests that the correct course specific login and registration urls work for shib
...
...
@@ -407,7 +407,7 @@ class ShibSPTest(ModuleStoreTestCase):
login_response
=
course_specific_login
(
login_request
,
'MITx/999/Robot_Super_Course'
)
reg_response
=
course_specific_register
(
login_request
,
'MITx/999/Robot_Super_Course'
)
if
"shib"
in
domain
:
if
domain
and
"shib"
in
domain
:
self
.
assertIsInstance
(
login_response
,
HttpResponseRedirect
)
self
.
assertEqual
(
login_response
[
'Location'
],
reverse
(
'shib-login'
)
+
...
...
common/djangoapps/external_auth/views.py
View file @
0ba1828f
...
...
@@ -597,7 +597,11 @@ def course_specific_login(request, course_id):
return
redirect_with_get
(
'signin_user'
,
request
.
GET
)
# now the dispatching conditionals. Only shib for now
if
settings
.
FEATURES
.
get
(
'AUTH_USE_SHIB'
)
and
course
.
enrollment_domain
.
startswith
(
SHIBBOLETH_DOMAIN_PREFIX
):
if
(
settings
.
FEATURES
.
get
(
'AUTH_USE_SHIB'
)
and
course
.
enrollment_domain
and
course
.
enrollment_domain
.
startswith
(
SHIBBOLETH_DOMAIN_PREFIX
)
):
return
redirect_with_get
(
'shib-login'
,
request
.
GET
)
# Default fallthrough to normal signin page
...
...
@@ -617,7 +621,11 @@ def course_specific_register(request, course_id):
return
redirect_with_get
(
'register_user'
,
request
.
GET
)
# now the dispatching conditionals. Only shib for now
if
settings
.
FEATURES
.
get
(
'AUTH_USE_SHIB'
)
and
course
.
enrollment_domain
.
startswith
(
SHIBBOLETH_DOMAIN_PREFIX
):
if
(
settings
.
FEATURES
.
get
(
'AUTH_USE_SHIB'
)
and
course
.
enrollment_domain
and
course
.
enrollment_domain
.
startswith
(
SHIBBOLETH_DOMAIN_PREFIX
)
):
# shib-login takes care of both registration and login flows
return
redirect_with_get
(
'shib-login'
,
request
.
GET
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment