Skip to content

fix: implement custom Cognito logout to use correct parameters - #299

Open
TamarW0 wants to merge 10 commits into
ga-releasefrom
APPENG-5865-logout-0
Open

fix: implement custom Cognito logout to use correct parameters#299
TamarW0 wants to merge 10 commits into
ga-releasefrom
APPENG-5865-logout-0

Conversation

@TamarW0

@TamarW0 TamarW0 commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

Quarkus OIDC's built-in logout sends id_token_hint and post_logout_redirect_uri,
but AWS Cognito requires client_id and logout_uri parameters instead.

  Quarkus OIDC's built-in logout sends id_token_hint and post_logout_redirect_uri,
  but AWS Cognito requires client_id and logout_uri parameters instead.
@vbelouso

vbelouso commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@TamarW0

TamarW0 commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator Author

/test exploit-iq-client-on-pr

@TamarW0

TamarW0 commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator Author

/test exploit-iq-client-on-pr

@TamarW0

TamarW0 commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator Author

/test exploit-iq-client-on-pr

@TamarW0
TamarW0 marked this pull request as ready for review August 6, 2026 14:38
@TamarW0
TamarW0 requested a review from rhartuv August 6, 2026 14:38

@zvigrinberg zvigrinberg left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Tamar,

Please see my comments.

Comment thread src/main/java/com/redhat/ecosystemappeng/exploitiq/rest/TokenResource.java Outdated
Comment thread src/main/java/com/redhat/ecosystemappeng/exploitiq/rest/TokenResource.java Outdated
@TamarW0

TamarW0 commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator Author

/test exploit-iq-client-on-pr

// Build logout redirect URI (application root, not API base)
// uriInfo.getBaseUri() returns https://host/api/v1/, we need https://host/
URI baseUri = uriInfo.getBaseUri();
String logoutRedirectUri = baseUri.getScheme() + "://" + baseUri.getAuthority() + "/";

@zvigrinberg zvigrinberg Aug 9, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TamarW0 UX issue ( chances are that QE will notice this behavior change in cognito vs. other Idps immediately) - it redirects to login in cognito immediately, without going through the LOGGED_OUT_HTML.

To resolve it, you can just go through a new GET endpoint path that cognito will call, and it will route to the LOGGED_OUT_HTML, which in turn , when pressing on the Login again button will redirect to /, so it will route to cognito for authentication

Suggested change
String logoutRedirectUri = baseUri.getScheme() + "://" + baseUri.getAuthority() + "/";
String logoutRedirectUri = baseUri.getScheme() + "://" + baseUri.getAuthority() + "/api/v1/user/logged-out";

New endpoint:

  @GET
    @Path("/logged-out")
    @Produces(MediaType.TEXT_HTML)
    @Operation(hidden = true)
    @PermitAll
    public Response loggedOut() {
         return buildLogoutResponse(Response.ok(LOGGED_OUT_HTML));

  - Invalidate OIDC session server-side before logout redirect
  - Add /logged-out endpoint to display success page after Cognito logout
  - Change Cognito redirect from / to /api/v1/user/logged-out
@TamarW0

TamarW0 commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator Author

/test exploit-iq-client-on-pr

@TamarW0

TamarW0 commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator Author

/test exploit-iq-client-on-pr

@TamarW0

TamarW0 commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator Author

/test exploit-iq-client-on-pr

@TamarW0

TamarW0 commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator Author

/test exploit-iq-client-on-pr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants