diff --git a/tdrs-backend/tdpservice/users/api/logout_redirect_oidc.py b/tdrs-backend/tdpservice/users/api/logout_redirect_oidc.py index 65c0bec09..4b6db4ff3 100644 --- a/tdrs-backend/tdpservice/users/api/logout_redirect_oidc.py +++ b/tdrs-backend/tdpservice/users/api/logout_redirect_oidc.py @@ -49,8 +49,7 @@ def get(self, request, *args, **kwargs): # params needed by the logout endpoint logout_params = { - "client_id": settings.LOGIN_GOV_CLIENT_ID, - "redirect_uri": settings.BASE_URL + "/logout", + "post_logout_redirect_uri": settings.BASE_URL + "/logout", "state": state, } @@ -58,10 +57,11 @@ def get(self, request, *args, **kwargs): # build out full API GET call to authorize endpoint if use_ams_handler: + logout_params["client_id"] = settings.AMS_CLIENT_ID ams_configuration = LoginRedirectAMS.get_ams_configuration() encoded_params = urlencode(logout_params, quote_via=quote_plus) return HttpResponseRedirect(ams_configuration["end_session_endpoint"] + "?" + encoded_params) else: - logout_params["post_logout_redirect_uri"] = logout_params.pop("redirect_uri") + logout_params["client_id"] = settings.LOGIN_GOV_CLIENT_ID encoded_params = urlencode(logout_params, quote_via=quote_plus) return HttpResponseRedirect(settings.LOGIN_GOV_LOGOUT_ENDPOINT + "?" + encoded_params)