From 34fa393a107d2fcab46546beb378d75aab7836b6 Mon Sep 17 00:00:00 2001 From: lahiruj Date: Tue, 17 Sep 2024 00:29:43 -0400 Subject: [PATCH] included email profile scopes for token renewal and removed redirect url from the logout request --- django_airavata/apps/auth/backends.py | 2 +- django_airavata/apps/auth/views.py | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/django_airavata/apps/auth/backends.py b/django_airavata/apps/auth/backends.py index e882c8e4..bd8292a0 100644 --- a/django_airavata/apps/auth/backends.py +++ b/django_airavata/apps/auth/backends.py @@ -160,7 +160,7 @@ def _get_token_and_userinfo_from_refresh_token(self, token_url = settings.KEYCLOAK_TOKEN_URL userinfo_url = settings.KEYCLOAK_USERINFO_URL verify_ssl = settings.KEYCLOAK_VERIFY_SSL - oauth2_session = OAuth2Session(client_id, scope='openid') + oauth2_session = OAuth2Session(client_id, scope='openid profile email') verify = verify_ssl if verify_ssl and hasattr(settings, 'KEYCLOAK_CA_CERTFILE'): verify = settings.KEYCLOAK_CA_CERTFILE diff --git a/django_airavata/apps/auth/views.py b/django_airavata/apps/auth/views.py index 02f0c86e..a05b2480 100644 --- a/django_airavata/apps/auth/views.py +++ b/django_airavata/apps/auth/views.py @@ -145,10 +145,7 @@ def handle_login(request): def start_logout(request): logout(request) - redirect_url = request.build_absolute_uri( - resolve_url(settings.LOGOUT_REDIRECT_URL)) - return redirect(settings.KEYCLOAK_LOGOUT_URL + - "?redirect_uri=" + quote(redirect_url)) + return redirect(settings.KEYCLOAK_LOGOUT_URL) def callback(request):