Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
greg
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
it-bott-integrasjoner
greg
Commits
d53ccafe
Commit
d53ccafe
authored
3 years ago
by
Andreas Ellewsen
Browse files
Options
Downloads
Plain Diff
Merge branch 'GREG-230-logout-redirect' into 'master'
Redirect on oidc logout See merge request
!306
parents
be0c4b48
947cac8f
No related branches found
No related tags found
1 merge request
!306
Redirect on oidc logout
Pipeline
#123292
passed
3 years ago
Stage: venv update
Stage: tests and linting
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
gregsite/settings/base.py
+1
-0
1 addition, 0 deletions
gregsite/settings/base.py
gregui/authentication/auth_backends.py
+10
-2
10 additions, 2 deletions
gregui/authentication/auth_backends.py
with
11 additions
and
2 deletions
gregsite/settings/base.py
+
1
−
0
View file @
d53ccafe
...
...
@@ -165,6 +165,7 @@ OIDC_OP_AUTHORIZATION_ENDPOINT = "https://auth.dataporten.no/oauth/authorization
OIDC_OP_TOKEN_ENDPOINT
=
"
https://auth.dataporten.no/oauth/token
"
OIDC_OP_USER_ENDPOINT
=
"
https://auth.dataporten.no/openid/userinfo
"
OIDC_OP_FEIDE_EXTENDED_USER_ENDPOINT
=
"
https://api.dataporten.no/userinfo/v1/userinfo
"
OIDC_STORE_ID_TOKEN
=
True
ALLOW_LOGOUT_GET_METHOD
=
True
OIDC_END_SESSION_ENDPOINT
=
"
https://auth.dataporten.no/openid/endsession
"
...
...
This diff is collapsed.
Click to expand it.
gregui/authentication/auth_backends.py
+
10
−
2
View file @
d53ccafe
import
datetime
import
re
import
time
import
urllib.parse
from
typing
import
Optional
import
requests
...
...
@@ -689,5 +690,12 @@ class GregOIDCBackend(ValidatingOIDCBackend):
def
provider_logout
(
request
):
redirect_url
=
settings
.
OIDC_END_SESSION_ENDPOINT
return
redirect_url
id_token
=
request
.
session
.
get
(
"
oidc_id_token
"
)
query_params
=
urllib
.
parse
.
urlencode
(
{
"
id_token_hint
"
:
id_token
,
"
post_logout_redirect_uri
"
:
settings
.
LOGOUT_REDIRECT_URL
,
}
)
logout_request_url
=
f
"
{
settings
.
OIDC_END_SESSION_ENDPOINT
}
?
{
query_params
}
"
return
logout_request_url
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