Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AMS Logout Redirect Bug Fix #3184

Merged
merged 8 commits into from
Sep 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions tdrs-backend/tdpservice/users/api/logout_redirect_oidc.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,19 @@ 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,
}

# escape params dict into a url encoded query string

# 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)
Loading