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
881732fa
Commit
881732fa
authored
4 years ago
by
pascoual
Browse files
Options
Downloads
Patches
Plain Diff
Add: ignore_scopes QUIRKS, user_id+username claims
parent
a520e78b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!20
Add 'remember me' button
,
!13
Add: ignore_scopes QUIRK
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
hiboo/application/sso.py
+2
-1
2 additions, 1 deletion
hiboo/application/sso.py
hiboo/sso/oidc.py
+5
-3
5 additions, 3 deletions
hiboo/sso/oidc.py
with
7 additions
and
4 deletions
hiboo/application/sso.py
+
2
−
1
View file @
881732fa
...
...
@@ -36,7 +36,8 @@ class GenericOIDCApplication(base.OIDCApplication):
special_mappings
=
fields
.
SelectMultipleField
(
_
(
'
Enabled special claim mappings
'
),
choices
=
[
(
"
mask_sub_uuid
"
,
_
(
"
Mask the profile uuid
"
)),
(
"
original_email
"
,
_
(
"
Return the actual user email
"
))
(
"
original_email
"
,
_
(
"
Return the actual user email
"
)),
(
"
ignore_scopes
"
,
_
(
"
Return all claims independently of asked scopes
"
))
]
)
submit
=
fields
.
SubmitField
(
_
(
'
Submit
'
))
...
...
This diff is collapsed.
Click to expand it.
hiboo/sso/oidc.py
+
5
−
3
View file @
881732fa
...
...
@@ -125,14 +125,16 @@ class Client(sqla_oauth2.OAuth2ClientMixin):
"""
special_mappings
=
self
.
service
.
config
.
get
(
"
special_mappings
"
,
[])
claims
=
dict
()
if
"
profile
"
in
scope
:
if
"
profile
"
in
scope
or
"
ignore_scopes
"
in
special_mappings
:
claims
.
update
(
sub
=
profile
.
username
if
"
mask_sub_uuid
"
in
special_mappings
else
profile
.
uuid
,
name
=
profile
.
username
,
preferred_username
=
profile
.
username
,
login
=
profile
.
username
login
=
profile
.
username
,
user_id
=
None
if
"
mask_sub_uuid
"
in
special_mappings
else
profile
.
uuid
,
username
=
profile
.
username
)
if
"
email
"
in
scope
:
if
"
email
"
in
scope
or
"
ignore_scopes
"
in
special_mappings
:
user_email
=
profile
.
user
.
contact
.
get
(
"
email
"
)
if
profile
.
user
.
contact
else
None
claims
.
update
(
email
=
user_email
if
"
original_email
"
in
special_mappings
else
profile
.
email
...
...
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