From 20d44f4c71a93c3bd0eb276a4889accd1b8ccb7f Mon Sep 17 00:00:00 2001 From: Shraddha Agrawal Date: Jul 24 2019 04:42:31 +0000 Subject: Add custom logout function --- diff --git a/happinesspackets/messaging/auth.py b/happinesspackets/messaging/auth.py index de22953..76ee6e3 100644 --- a/happinesspackets/messaging/auth.py +++ b/happinesspackets/messaging/auth.py @@ -5,6 +5,10 @@ import yaml with open("config.yml", 'r') as ymlfile: cfg = yaml.full_load(ymlfile) +def provider_logout(request): + redirect_url = 'https://iddev.fedorainfracloud.org/logout' + return redirect_url + class OIDC(OIDCAuthenticationBackend): def update_user(self, user, claims): if user.username in cfg['auth']['admins']: diff --git a/happinesspackets/settings/base.py b/happinesspackets/settings/base.py index ee43ff9..3715b50 100644 --- a/happinesspackets/settings/base.py +++ b/happinesspackets/settings/base.py @@ -155,6 +155,7 @@ LOGOUT_REDIRECT_URL = '/' LOGIN_REDIRECT_URL_FAILURE = '/error' LOGIN_URL = '/oidc/authenticate/' OIDC_RP_SCOPES = 'openid profile email' +OIDC_OP_LOGOUT_URL_METHOD = 'happinesspackets.messaging.auth.provider_logout' LOGGING = { 'version': 1,