Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Helios Server
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TO
Helios Server
Commits
f9402f85
Commit
f9402f85
authored
14 years ago
by
Ben Adida
Browse files
Options
Downloads
Patches
Plain Diff
updated CAS
parent
f84bb93e
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
auth/auth_systems/cas.py
+13
-4
13 additions, 4 deletions
auth/auth_systems/cas.py
auth/media/login-icons/cas.png
+0
-0
0 additions, 0 deletions
auth/media/login-icons/cas.png
with
13 additions
and
4 deletions
auth/auth_systems/cas.py
+
13
−
4
View file @
f9402f85
...
@@ -34,7 +34,8 @@ def _get_service_url():
...
@@ -34,7 +34,8 @@ def _get_service_url():
return
settings
.
URL_HOST
+
reverse
(
after
)
return
settings
.
URL_HOST
+
reverse
(
after
)
def
get_auth_url
(
request
):
def
get_auth_url
(
request
,
redirect_url
):
request
.
session
[
'
cas_redirect_url
'
]
=
redirect_url
return
CAS_URL
+
'
login?service=
'
+
urllib
.
quote
(
_get_service_url
())
return
CAS_URL
+
'
login?service=
'
+
urllib
.
quote
(
_get_service_url
())
def
get_user_category
(
user_id
):
def
get_user_category
(
user_id
):
...
@@ -93,7 +94,10 @@ def get_user_info(user_id):
...
@@ -93,7 +94,10 @@ def get_user_info(user_id):
# get the value elements (a bit of a hack but no big deal)
# get the value elements (a bit of a hack but no big deal)
values
=
response_doc
.
getElementsByTagName
(
'
value
'
)
values
=
response_doc
.
getElementsByTagName
(
'
value
'
)
if
len
(
values
)
>
0
:
return
{
'
name
'
:
values
[
0
].
firstChild
.
wholeText
,
'
category
'
:
values
[
1
].
firstChild
.
wholeText
}
return
{
'
name
'
:
values
[
0
].
firstChild
.
wholeText
,
'
category
'
:
values
[
1
].
firstChild
.
wholeText
}
else
:
return
None
def
get_user_info_after_auth
(
request
):
def
get_user_info_after_auth
(
request
):
ticket
=
request
.
GET
.
get
(
'
ticket
'
,
None
)
ticket
=
request
.
GET
.
get
(
'
ticket
'
,
None
)
...
@@ -113,9 +117,14 @@ def get_user_info_after_auth(request):
...
@@ -113,9 +117,14 @@ def get_user_info_after_auth(request):
netid
=
r
[
1
].
strip
()
netid
=
r
[
1
].
strip
()
category
=
get_user_category
(
netid
)
category
=
get_user_category
(
netid
)
user_info
=
get_user_info
(
netid
)
if
user_info
:
info
=
{
'
name
'
:
user_info
[
'
name
'
],
'
category
'
:
category
}
else
:
info
=
{
'
name
'
:
netid
,
'
category
'
:
category
}
info
=
{
'
name
'
:
netid
,
'
category
'
:
category
}
return
{
'
type
'
:
'
cas
'
,
'
user_id
'
:
netid
,
'
name
'
:
netid
,
'
info
'
:
info
,
'
token
'
:
None
}
return
{
'
type
'
:
'
cas
'
,
'
user_id
'
:
netid
,
'
name
'
:
info
[
'
name
'
]
,
'
info
'
:
info
,
'
token
'
:
None
}
else
:
else
:
return
None
return
None
...
...
This diff is collapsed.
Click to expand it.
auth/media/login-icons/cas.png
0 → 100644
+
0
−
0
View file @
f9402f85
6.67 KiB
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment