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
5dfd40c1
Commit
5dfd40c1
authored
Nov 25, 2010
by
Ed Crewe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add alternative /proxyValidate to /login url if its a proxy ticket
parent
7e3dc58a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
7 deletions
+9
-7
django_cas/models.py
+2
-2
django_cas/views.py
+7
-5
No files found.
django_cas/models.py
View file @
5dfd40c1
...
...
@@ -6,7 +6,7 @@ from django.contrib.auth.models import User
from
django.core.exceptions
import
ObjectDoesNotExist
from
django_cas.exceptions
import
CasTicketException
,
CasConfigException
class
Auth
Tgt
(
models
.
Model
):
class
Tgt
(
models
.
Model
):
username
=
models
.
CharField
(
max_length
=
255
,
unique
=
True
)
tgt
=
models
.
CharField
(
max_length
=
255
)
...
...
@@ -40,7 +40,7 @@ class AuthTgt(models.Model):
finally
:
page
.
close
()
class
Auth
PgtIOU
(
models
.
Model
):
class
PgtIOU
(
models
.
Model
):
pgtIou
=
models
.
CharField
(
max_length
=
255
,
unique
=
True
)
tgt
=
models
.
CharField
(
max_length
=
255
)
timestamp
=
models
.
DateTimeField
(
auto_now
=
True
)
...
...
django_cas/views.py
View file @
5dfd40c1
...
...
@@ -43,13 +43,15 @@ def _redirect_url(request):
return
next
def
_login_url
(
service
):
def
_login_url
(
service
,
ticket
=
'ST'
):
"""Generates CAS login URL"""
LOGINS
=
{
'ST'
:
'login'
,
'PT'
:
'proxyValidate'
}
params
=
{
'service'
:
service
}
if
settings
.
CAS_EXTRA_LOGIN_PARAMS
:
params
.
update
(
settings
.
CAS_EXTRA_LOGIN_PARAMS
)
return
urljoin
(
settings
.
CAS_SERVER_URL
,
'login'
)
+
'?'
+
urlencode
(
params
)
login
=
LOGINS
.
get
(
ticket
[:
2
],
'login'
)
return
urljoin
(
settings
.
CAS_SERVER_URL
,
login
)
+
'?'
+
urlencode
(
params
)
def
_logout_url
(
request
,
next_page
=
None
):
...
...
@@ -85,12 +87,12 @@ def login(request, next_page=None, required=False):
user
.
message_set
.
create
(
message
=
message
)
return
HttpResponseRedirect
(
next_page
)
elif
settings
.
CAS_RETRY_LOGIN
or
required
:
return
HttpResponseRedirect
(
_login_url
(
service
))
return
HttpResponseRedirect
(
_login_url
(
service
,
ticket
))
else
:
error
=
"<h1>Forbidden</h1><p>Login failed.</p>"
return
HttpResponseForbidden
(
error
)
else
:
return
HttpResponseRedirect
(
_login_url
(
service
))
return
HttpResponseRedirect
(
_login_url
(
service
,
ticket
))
def
logout
(
request
,
next_page
=
None
):
...
...
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