Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
LOFAR
Manage
Activity
Members
Labels
Plan
Issues
Wiki
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
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
RadioObservatory
LOFAR
Commits
50687a42
Commit
50687a42
authored
3 years ago
by
Jörn Künsemöller
Browse files
Options
Downloads
Patches
Plain Diff
TMSS-719
: Include more user detail in authentication_state and set proper user name
parent
7c177abb
No related branches found
No related tags found
2 merge requests
!634
WIP: COBALT commissioning delta
,
!567
TMSS-719: Include more user detail in authentication_state and set proper user name
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
SAS/TMSS/backend/src/tmss/authentication_backends.py
+5
-0
5 additions, 0 deletions
SAS/TMSS/backend/src/tmss/authentication_backends.py
SAS/TMSS/backend/src/tmss/tmssapp/views.py
+3
-1
3 additions, 1 deletion
SAS/TMSS/backend/src/tmss/tmssapp/views.py
with
8 additions
and
1 deletion
SAS/TMSS/backend/src/tmss/authentication_backends.py
+
5
−
0
View file @
50687a42
...
...
@@ -62,6 +62,11 @@ class TMSSOIDCAuthenticationBackend(OIDCAuthenticationBackend):
def
create_user
(
self
,
claims
):
user
=
super
(
TMSSOIDCAuthenticationBackend
,
self
).
create_user
(
claims
)
logger
.
info
(
'
### create user=%s claims=%s
'
%
(
user
,
claims
))
# take some more user details from claims # todo: check GDPR compliance!
user
.
first_name
=
claims
.
get
(
'
given_name
'
,
user
.
first_name
)
user
.
last_name
=
claims
.
get
(
'
family_name
'
,
user
.
last_name
)
user
.
username
=
claims
.
get
(
'
preferred_username
'
,
user
.
username
)
user
.
save
()
self
.
_set_user_project_roles_from_claims
(
user
,
claims
)
self
.
_set_user_system_roles_from_claims
(
user
,
claims
)
return
user
...
...
This diff is collapsed.
Click to expand it.
SAS/TMSS/backend/src/tmss/tmssapp/views.py
+
3
−
1
View file @
50687a42
...
...
@@ -73,7 +73,9 @@ def authentication_state(request):
return
JsonResponse
({
'
is_authenticated
'
:
False
})
return
JsonResponse
({
'
is_authenticated
'
:
True
,
'
username
'
:
request
.
user
.
username
})
'
username
'
:
request
.
user
.
username
,
'
email
'
:
request
.
user
.
email
,
'
id
'
:
request
.
user
.
id
})
# Allow everybody to GET our publicly available template-json-schema's
...
...
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