Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-cas
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
OpenEdx
django-cas
Commits
4e64c503
Commit
4e64c503
authored
Dec 09, 2010
by
Ed Crewe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix broken proxy auth check
parent
9d56c5a2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
22 deletions
+22
-22
django_cas/backends.py
+19
-21
django_cas/tests/cas_tests.py
+3
-1
No files found.
django_cas/backends.py
View file @
4e64c503
...
@@ -49,27 +49,25 @@ def _verify_cas2(ticket, service):
...
@@ -49,27 +49,25 @@ def _verify_cas2(ticket, service):
urlencode
(
params
))
urlencode
(
params
))
page
=
urlopen
(
url
)
page
=
urlopen
(
url
)
response
=
page
.
read
()
try
:
tree
=
ElementTree
.
fromstring
(
response
)
response
=
page
.
read
()
page
.
close
()
tree
=
ElementTree
.
fromstring
(
response
)
if
tree
[
0
]
.
tag
.
endswith
(
'authenticationSuccess'
):
if
tree
[
0
]
.
tag
.
endswith
(
'authenticationSuccess'
):
username
=
tree
[
0
][
0
]
.
text
username
=
tree
[
0
][
0
]
.
text
if
len
(
tree
[
0
])
>=
2
and
tree
[
0
][
1
]
.
tag
.
endswith
(
'proxyGrantingTicket'
):
if
len
(
tree
[
0
])
>=
2
and
tree
[
0
][
1
]
.
tag
.
endswith
(
'proxyGrantingTicket'
):
pgtIou
=
PgtIOU
.
objects
.
get
(
pgtIou
=
tree
[
0
][
1
]
.
text
)
pgtIou
=
PgtIOU
.
objects
.
get
(
pgtIou
=
tree
[
0
][
1
]
.
text
)
try
:
try
:
tgt
=
Tgt
.
objects
.
get
(
username
=
username
)
tgt
=
Tgt
.
objects
.
get
(
username
=
username
)
tgt
.
tgt
=
pgtIou
.
tgt
tgt
.
tgt
=
pgtIou
.
tgt
tgt
.
save
()
tgt
.
save
()
except
ObjectDoesNotExist
:
except
ObjectDoesNotExist
:
Tgt
.
objects
.
create
(
username
=
username
,
tgt
=
pgtIou
.
tgt
)
Tgt
.
objects
.
create
(
username
=
username
,
tgt
=
pgtIou
.
tgt
)
pgtIou
.
delete
()
pgtIou
.
delete
()
return
username
return
username
else
:
else
:
return
None
return
None
finally
:
page
.
close
()
def
verify_proxy_ticket
(
ticket
,
service
):
def
verify_proxy_ticket
(
ticket
,
service
):
...
...
django_cas/tests/cas_tests.py
View file @
4e64c503
...
@@ -98,6 +98,7 @@ class TestCAS(unittest.TestCase):
...
@@ -98,6 +98,7 @@ class TestCAS(unittest.TestCase):
print
'PASS: Got PT -
%
s'
%
pt
print
'PASS: Got PT -
%
s'
%
pt
else
:
else
:
print
pt
print
pt
#self.logout()
print
''
print
''
print
'Test SSO server login with proxy ticket'
print
'Test SSO server login with proxy ticket'
...
@@ -107,7 +108,8 @@ class TestCAS(unittest.TestCase):
...
@@ -107,7 +108,8 @@ class TestCAS(unittest.TestCase):
print
'PASS: Got Success response for app
%
s using proxy
%
s'
%
(
self
.
urls
[
'app'
],
proxy
)
print
'PASS: Got Success response for app
%
s using proxy
%
s'
%
(
self
.
urls
[
'app'
],
proxy
)
else
:
else
:
print
'FAIL: The proxy login to
%
s via
%
s has failed'
%
(
self
.
urls
[
'app'
],
self
.
urls
[
'proxy'
])
print
'FAIL: The proxy login to
%
s via
%
s has failed'
%
(
self
.
urls
[
'app'
],
self
.
urls
[
'proxy'
])
self
.
logout
()
print
''
print
''
print
'Test direct proxy login'
print
'Test direct proxy login'
print
'-----------------------'
print
'-----------------------'
...
...
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