Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
kszkepzes-backend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
JetBrains YouTrack
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
KSZK
DevTeam
kszkepzes
old
kszkepzes-backend
Commits
21a9d25e
Commit
21a9d25e
authored
1 year ago
by
Gelencsér Ákos
Browse files
Options
Downloads
Patches
Plain Diff
fix: iodc login errors
parent
6990bc5c
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!15
Many stuff
Pipeline
#48874
passed with warnings
1 year ago
Stage: Test and Flake8
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/kszkepzes/oidc_auth.py
+6
-0
6 additions, 0 deletions
src/kszkepzes/oidc_auth.py
src/kszkepzes/settings/base.py
+2
-2
2 additions, 2 deletions
src/kszkepzes/settings/base.py
with
8 additions
and
2 deletions
src/kszkepzes/oidc_auth.py
+
6
−
0
View file @
21a9d25e
from
mozilla_django_oidc.auth
import
OIDCAuthenticationBackend
from
account
import
models
from
common.email
import
registration
class
JSOIDCAuthBackend
(
OIDCAuthenticationBackend
):
...
...
@@ -7,6 +9,10 @@ class JSOIDCAuthBackend(OIDCAuthenticationBackend):
user
.
first_name
=
claims
.
get
(
'
given_name
'
,
''
)
user
.
last_name
=
claims
.
get
(
'
family_name
'
,
''
)
user
.
save
()
models
.
Profile
.
objects
.
create
(
user
=
user
)
if
user
.
email
is
not
None
:
registration
.
delay
(
{
'
last_name
'
:
user
.
last_name
,
'
first_name
'
:
user
.
first_name
,
'
email
'
:
user
.
email
})
return
user
def
update_user
(
self
,
user
,
claims
):
...
...
This diff is collapsed.
Click to expand it.
src/kszkepzes/settings/base.py
+
2
−
2
View file @
21a9d25e
...
...
@@ -128,7 +128,7 @@ AUTH_PASSWORD_VALIDATORS = [
AUTHENTICATION_BACKENDS
=
[
'
backend
.oidc_auth.JSOIDCAuthBackend
'
,
'
kszkepzes
.oidc_auth.JSOIDCAuthBackend
'
,
]
...
...
@@ -157,7 +157,7 @@ OIDC_RP_SIGN_ALGO = os.environ.get('OIDC_SIGN_ALGO', 'RS256')
OIDC_EXEMPT_URLS
=
[
"
/healthz/
"
,
"
/admin/
"
,
"
/oidc/
"
]
LOGIN_REDIRECT_URL
=
"
/
"
LOGOUT_REDIRECT_URL
=
"
/
"
OIDC_USERNAME_ALGO
=
'
backend
.oidc_auth.generate_username
'
OIDC_USERNAME_ALGO
=
'
kszkepzes
.oidc_auth.generate_username
'
# Internationalization
...
...
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