Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Hiboo
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ACIDES
Hiboo
Commits
76cb3b97
Commit
76cb3b97
authored
5 years ago
by
kaiyou
Browse files
Options
Downloads
Patches
Plain Diff
Fix the saml sso after the change to uuid
parent
f1d17613
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
trurt/sso/forms.py
+1
-2
1 addition, 2 deletions
trurt/sso/forms.py
trurt/sso/saml.py
+6
-6
6 additions, 6 deletions
trurt/sso/saml.py
trurt/sso/templates/sso_pick.html
+0
-15
0 additions, 15 deletions
trurt/sso/templates/sso_pick.html
trurt/utils.py
+1
-1
1 addition, 1 deletion
trurt/utils.py
with
8 additions
and
24 deletions
trurt/sso/forms.py
+
1
−
2
View file @
76cb3b97
...
...
@@ -5,5 +5,4 @@ import flask_wtf
class
SSOValidateForm
(
flask_wtf
.
FlaskForm
):
service_id
=
fields
.
IntegerField
(
'
service
'
,
[])
profile_id
=
fields
.
IntegerField
(
'
profile
'
,
[])
profile_uuid
=
fields
.
TextField
(
'
profile
'
,
[])
This diff is collapsed.
Click to expand it.
trurt/sso/saml.py
+
6
−
6
View file @
76cb3b97
...
...
@@ -96,18 +96,18 @@ class SecurityContext(sigver.SecurityContext):
def
redirect
(
service_uuid
):
service
=
models
.
Service
.
query
.
get
(
service_uuid
)
or
flask
.
abort
(
404
)
return
flask
.
redirect
(
utils
.
url_for
(
"
account.pick
"
,
intent
=
"
sso.reply
"
,
service_
spn
=
service_
spn
,
"
account.pick
"
,
intent
=
"
sso.reply
"
,
service_
uuid
=
service_
uuid
,
))
@blueprint.route
(
'
/saml/reply
'
,
methods
=
[
"
POST
"
])
def
reply
():
@blueprint.route
(
'
/saml/
<service_uuid>/
reply
'
,
methods
=
[
"
POST
"
])
def
reply
(
service_uuid
):
# First check the service and picked profile
form
=
forms
.
SSOValidateForm
()
form
.
validate
()
or
flask
.
abort
(
403
)
service
=
models
.
Service
.
query
.
get
(
service_uuid
)
or
flask
.
abort
(
404
)
profile
=
models
.
Profile
.
query
.
get
(
profile_uuid
)
or
flask
.
abort
(
404
)
if
not
(
profile
.
user
is
flask_login
.
current_user
and
profile
.
service
is
service
):
profile
=
models
.
Profile
.
query
.
get
(
form
.
profile_uuid
.
data
)
or
flask
.
abort
(
404
)
if
not
(
profile
.
user
==
flask_login
.
current_user
and
profile
.
service
==
service
):
return
flask
.
abort
(
403
)
# Parse the authentication request
idp
=
server
.
Server
(
config
=
(
MetaData
.
get_config
(
service
)))
...
...
@@ -116,7 +116,7 @@ def reply():
if
not
service
.
config
[
"
acs
"
]
==
request
.
message
.
issuer
.
text
:
return
flask
.
abort
(
403
)
# Provide a SAML response
response
=
idp
.
c
class_ref
reate_authn_response
(
response
=
idp
.
create_authn_response
(
identity
=
{
'
uid
'
:
profile
.
username
,
'
email
'
:
profile
.
email
...
...
This diff is collapsed.
Click to expand it.
trurt/sso/templates/sso_pick.html
deleted
100644 → 0
+
0
−
15
View file @
f1d17613
{% extends "base.html" %}
{% block title %}Pick a profile{% endblock %}
{% block subtitle %}for the service {{ service.spn }}{% endblock %}
{% block content %}
{% for profile in profiles %}
<form
method=
"POST"
action=
"{{ action }}"
>
{{ form.hidden_tag() }}
<input
type=
"hidden"
name=
"service_id"
value=
"{{ service.id }}"
>
<input
type=
"hidden"
name=
"profile_id"
value=
"{{ profile.id }}"
>
<input
type=
"submit"
value=
"{{ profile.username }}"
>
</form>
{% endfor %}
{% endblock %}
This diff is collapsed.
Click to expand it.
trurt/utils.py
+
1
−
1
View file @
76cb3b97
...
...
@@ -42,7 +42,7 @@ def url_or_intent(endpoint):
intents
=
flask
.
request
.
args
.
get
(
INTENTS
,
""
)
if
intents
:
intents
=
intents
.
split
(
"
:
"
)
return
url_for
(
intents
.
pop
(
0
),
intents
=
"
:
"
.
join
(
intents
)
or
None
)
return
url_for
(
intents
.
pop
(),
intents
=
"
:
"
.
join
(
intents
)
or
None
)
else
:
return
flask
.
url_for
(
endpoint
)
...
...
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