Skip to content

Sign out without a confirmation prompt - #4455

Merged
madurangasiriwardena merged 1 commit into
thunder-id:mainfrom
madurangasiriwardena:signout-without-confirmation-prompt
Jul 31, 2026
Merged

Sign out without a confirmation prompt#4455
madurangasiriwardena merged 1 commit into
thunder-id:mainfrom
madurangasiriwardena:signout-without-confirmation-prompt

Conversation

@madurangasiriwardena

@madurangasiriwardena madurangasiriwardena commented Jul 31, 2026

Copy link
Copy Markdown
Member

Purpose

Signing out of the console required an extra confirmation click, and the RP-initiated logout request carried the user's ID token in the URL query string, where reverse proxies, load balancers, browser history and Referer headers all record it. This PR removes the confirmation step from the default sign-out experience, keeps the ID token out of logout URLs, and fixes a bug that made a POST to the end_session_endpoint behave differently from a GET.

  1. Default Sign Out Flow no longer prompts. The flow graph went from start -> prompt_confirm -> session_signout -> end to start -> session_signout -> end. The prompt was unconditional, so this is what actually removes the click. Applies to every application on the default-flow sign-out handle, not just the console.
  2. Console stops sending id_token_hint. sendIdTokenInLogoutRequest: false in the console's SDK defaults makes the SDK send client_id instead. It sits in sdkDefaults, so operators can still override it through config.sdk.
  3. Logout handler reads the form body. handler.go built its parameter map from r.URL.Query(). On a POST the parameters arrive in the body, so the map was empty and the sign-out flow's InitiatorRequest.QueryParams received nothing. Now sourced from r.Form, which ParseForm populates from both the query string and the body.
  4. New "Silent Sign Out" template that goes straight to SessionSignOutExecutor, mirroring the new default. The existing "Confirm & Sign Out" and "Conditional Confirmation" templates are unchanged.

Approach

Why drop id_token_hint rather than keep it. The hint is optional in OIDC RP-Initiated Logout, and across the use cases we have seen it earns very little. ThunderID resolves the session to terminate from the per-flow SSO cookie, not from the hint. All the hint does is resolve the client id, which client_id does directly, and the post_logout_redirect_uri is validated against the client's registered list either way. That leaves a signed token carrying identity claims sitting in a URL for no practical gain, so the console stops sending it. Having the SDK issue the sign-out as a POST is a worthwhile improvement in its own right and the backend already accepts both methods, but it is not a prerequisite for this change.

Consequence worth reviewing. The one thing the hint bought is attribution. Per OIDC RP-Initiated Logout the OP must ask the End-User to confirm when no id_token_hint is supplied, precisely because the request is then unattributable. With the prompt removed as well, /oauth2/logout?client_id=CONSOLE&post_logout_redirect_uri=... is a complete unauthenticated sign-out request: any page can navigate a signed-in user's browser to it and terminate their SSO session. The impact is nuisance-grade (forced logout, no data exposure), but reviewers should know it now applies to every application on the default flow.

What was deliberately left alone. The promptOnSignOut executor property and the logoutPromptRequired runtime key are untouched, so the conditional sign-out path still works for anyone who opts into it. Note that this conditional path is only reachable through /oauth2/logout: the flag has a single writer in the OAuth logout layer, so a SIGNOUT flow initiated directly through POST /flow/execute never prompts.

Related Issues

  • N/A

Related PRs

  • N/A

Checklist

  • Followed the contribution guidelines.
  • Manual test round performed and verified.
  • Documentation provided. (Add links if there are any)
    • Ran Vale and fixed all errors and warnings
  • Tests provided. (Add links if there are any)
    • Unit Tests
    • Integration Tests
  • Breaking changes. (Fill if applicable)
    • Breaking changes section filled.
    • breaking change label added.

Security checks

  • Followed secure coding standards in WSO2 Secure Coding Guidelines
  • Confirmed that this PR doesn't commit any keys, passwords, tokens, usernames, or other secrets.

Summary by CodeRabbit

  • New Features

    • Added a new "Silent Sign Out Flow" template for direct sign-out without confirmation prompts.
  • Bug Fixes

    • Fixed logout flow to properly forward form-encoded body parameters alongside query parameters.
  • Updates

    • Updated sign-out template display labels and descriptions for clarity.
    • Adjusted ID token handling during logout requests.

Drop the unconditional confirmation prompt from the Default Sign Out
Flow so signing out completes on the first flow execution, and stop
sending id_token_hint from the console so no signed token carrying
identity claims lands in the sign-out URL.

Read the logout parameters from r.Form rather than the query string.
On a POST to the end_session_endpoint the parameters arrive in the
form body, so the query string carried none of them and the sign-out
flow received an empty parameter set.

Add a sign-out flow template that terminates the session with no
confirmation step, mirroring the new default.
@ThaminduDilshan ThaminduDilshan added Type/Improvement trigger-pr-builder Add when the PR is ready for CI; starts the PR Builder for this and all later pushes labels Jul 31, 2026
@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The default sign-out flow now bypasses the confirmation prompt and calls session sign-out directly. A new console template applies the same direct behavior. The OAuth logout handler forwards form-body parameters alongside query parameters. The ThunderID SDK config disables ID token transmission during logout by default.

Changes

Direct sign-out flow, logout form handling, and ID token config

Layer / File(s) Summary
Default sign-out flow bypasses confirmation
backend/cmd/server/bootstrap/01-default-resources.yaml
The flow transitions from start directly to session_signout. The confirmation prompt and its action wiring are removed. Node layout positions are updated.
Console silent sign-out template
frontend/apps/console/src/features/flows/data/templates.json
A new DIRECT/SIGNOUT template, "Silent Sign Out Flow," routes START to SessionSignOutExecutor to END without confirmation. The conditional sign-out template's label and description are revised.
Logout handler forwards form-body parameters
backend/internal/oauth/oauth2/logout/handler.go, backend/internal/oauth/oauth2/logout/handler_test.go
HandleLogout reads parameters from r.Form instead of only r.URL.Query(), so POST body parameters are included. Tests verify form-encoded parameters, including state, reach the sign-out flow with correct redirect behavior.
Disable ID token in logout requests by default
frontend/apps/console/src/hocs/withConfig.tsx, frontend/apps/console/src/hocs/__tests__/withConfig.test.tsx
The default ThunderID SDK config sets sendIdTokenInLogoutRequest to false, overridable by config.sdk. Tests confirm the mocked provider receives this value as false.

Estimated code review effort: 2 (Simple) | ~12 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant LogoutHandler
  participant SignOutFlow
  Client->>LogoutHandler: POST /logout (form body with state)
  LogoutHandler->>LogoutHandler: ParseForm merges r.Form
  LogoutHandler->>SignOutFlow: forward sanitized parameters (state)
  SignOutFlow-->>Client: redirect response
Loading

Possibly related PRs

  • thunder-id/thunderid#4206: Updates the same default sign-out flow and sign-out templates in the bootstrap YAML and templates.json files.
  • thunder-id/thunderid#4299: Modifies RP-initiated logout handling and the sign-out flow's confirmation/direct execution behavior, including SessionSignOutExecutor and templates.
  • thunder-id/thunderid#4369: Modifies withConfig and its tests to adjust ThunderIDProvider logout configuration.

Suggested reviewers: donomalvindula, thiva-k, thamindudilshan

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the primary change: removing the sign-out confirmation prompt.
Description check ✅ Passed The description covers the purpose, approach, affected behavior, security consequence, related items, and checklist structure.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Fix failing CI checks
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

frontend/apps/console/src/hocs/__tests__/withConfig.test.tsx

ESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox.

frontend/apps/console/src/hocs/withConfig.tsx

ESLint skipped: the ESLint configuration for this file references a package that is not available in the sandbox.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@backend/cmd/server/bootstrap/01-default-resources.yaml`:
- Around line 578-593: The sign-out flow and OAuth logout behavior require
documentation updates. In the relevant sign-out guide under
docs/content/guides/, document immediate default sign-out, the Silent Sign Out
template, and Conditional Confirmation behavior; in docs/content/apis.mdx,
document form-encoded POST support for the logout endpoint and its accepted
parameters. The YAML, templates.json, and handler.go sites require no direct
code changes.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: cf6c8a80-a2d6-4ecf-bedc-5c2d3c371825

📥 Commits

Reviewing files that changed from the base of the PR and between 3812f0d and 90d7043.

📒 Files selected for processing (6)
  • backend/cmd/server/bootstrap/01-default-resources.yaml
  • backend/internal/oauth/oauth2/logout/handler.go
  • backend/internal/oauth/oauth2/logout/handler_test.go
  • frontend/apps/console/src/features/flows/data/templates.json
  • frontend/apps/console/src/hocs/__tests__/withConfig.test.tsx
  • frontend/apps/console/src/hocs/withConfig.tsx

Comment on lines +578 to +593
onSuccess: session_signout
layout:
size:
width: 101
height: 34
position:
x: 62
y: 278
- id: prompt_confirm
type: PROMPT
layout:
size:
width: 350
height: 300
position:
x: 463
y: 150
meta:
components:
- type: TEXT
id: text_signout_title
label: '{{ t(signout:forms.confirm.title) }}'
variant: HEADING_1
- type: TEXT
id: text_signout_desc
label: '{{ t(signout:forms.confirm.description) }}'
variant: BODY_1
- type: BLOCK
id: block_signout
components:
- type: ACTION
id: action_confirm
label: '{{ t(signout:forms.confirm.actions.submit.label) }}'
variant: PRIMARY
eventType: SUBMIT
prompts:
- action:
ref: action_confirm
nextNode: session_signout
- id: session_signout
type: TASK_EXECUTION
layout:
size:
width: 217
height: 113
position:
x: 960
x: 463

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

🔴 Documentation Required

This PR introduces user-facing changes that are not covered by documentation updates under docs/.
Please update the relevant documentation before merging.

Missing documentation:

  • Default and console sign-out flows: Update the relevant sign-out flow guide under docs/content/guides/ to describe immediate default sign-out, the Silent Sign Out template, and Conditional Confirmation behavior.
  • OAuth logout POST parameters: Update docs/content/apis.mdx to document form-encoded POST support for the logout endpoint and its accepted parameters.
📍 Affects 3 files
  • backend/cmd/server/bootstrap/01-default-resources.yaml#L578-L593 (this comment)
  • frontend/apps/console/src/features/flows/data/templates.json#L12898-L12963
  • backend/internal/oauth/oauth2/logout/handler.go#L73-L75
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@backend/cmd/server/bootstrap/01-default-resources.yaml` around lines 578 -
593, The sign-out flow and OAuth logout behavior require documentation updates.
In the relevant sign-out guide under docs/content/guides/, document immediate
default sign-out, the Silent Sign Out template, and Conditional Confirmation
behavior; in docs/content/apis.mdx, document form-encoded POST support for the
logout endpoint and its accepted parameters. The YAML, templates.json, and
handler.go sites require no direct code changes.

Source: Path instructions

@codecov

codecov Bot commented Jul 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@madurangasiriwardena
madurangasiriwardena added this pull request to the merge queue Jul 31, 2026
Merged via the queue into thunder-id:main with commit 8f80ac9 Jul 31, 2026
58 of 66 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

trigger-pr-builder Add when the PR is ready for CI; starts the PR Builder for this and all later pushes Type/Improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants