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
58cf539c
Commit
58cf539c
authored
Nov 25, 2009
by
Brodie Rao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented CAS_RETRY_LOGIN
parent
1c70294e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
1 deletions
+6
-1
README.txt
+2
-0
django_cas/__init__.py
+1
-0
django_cas/views.py
+3
-1
No files found.
README.txt
View file @
58cf539c
...
...
@@ -55,6 +55,8 @@ Optional settings include:
won't log the user out of CAS as well.
* `CAS_REDIRECT_URL`: Where to send a user after logging in or out if
there is no referrer and no next page set. Default is `/`.
* `CAS_RETRY_LOGIN`: If `True` and an unknown or invalid ticket is
received, the user is redirected back to the login page.
* `CAS_VERSION`: The CAS protocol version to use. `'1'` and `'2'` are
supported, with `'2'` being the default.
...
...
django_cas/__init__.py
View file @
58cf539c
...
...
@@ -10,6 +10,7 @@ _DEFAULTS = {
'CAS_IGNORE_REFERER'
:
False
,
'CAS_LOGOUT_COMPLETELY'
:
True
,
'CAS_REDIRECT_URL'
:
'/'
,
'CAS_RETRY_LOGIN'
:
False
,
'CAS_SERVER_URL'
:
None
,
'CAS_VERSION'
:
'2'
,
}
...
...
django_cas/views.py
View file @
58cf539c
...
...
@@ -62,7 +62,7 @@ def _logout_url(request, next_page=None):
return
url
def
login
(
request
,
next_page
=
None
):
def
login
(
request
,
next_page
=
None
,
required
=
False
):
"""Forwards to CAS login URL or verifies CAS ticket"""
if
not
next_page
:
...
...
@@ -82,6 +82,8 @@ def login(request, next_page=None):
message
=
"Login succeeded. Welcome,
%
s."
%
name
user
.
message_set
.
create
(
message
=
message
)
return
HttpResponseRedirect
(
next_page
)
elif
settings
.
CAS_RETRY_LOGIN
or
required
:
return
HttpResponseRedirect
(
_login_url
(
service
))
else
:
error
=
"<h1>Forbidden</h1><p>Login failed.</p>"
return
HttpResponseForbidden
(
error
)
...
...
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