Skip to content

Document session logout for OIDC and app-native flows - #4291

Open
madurangasiriwardena wants to merge 1 commit into
thunder-id:mainfrom
madurangasiriwardena:document-session-logout
Open

Document session logout for OIDC and app-native flows#4291
madurangasiriwardena wants to merge 1 commit into
thunder-id:mainfrom
madurangasiriwardena:document-session-logout

Conversation

@madurangasiriwardena

@madurangasiriwardena madurangasiriwardena commented Jul 23, 2026

Copy link
Copy Markdown
Member

Purpose

Adds product documentation for session logout, covering both the OIDC redirect-based path and the app-native flow path. This documents the RP-initiated logout endpoint and the sign-out flow that were added to the backend, so integrators know how to end a user's SSO session (not just their local application session).

Changes:

  • New page: RP-Initiated Logout (guides/protocols/oauth-oidc/rp-initiated-logout.mdx) covering the end_session_endpoint (GET/POST /oauth2/logout): the sequence, request methods, request parameters, validation rules, and the sign-out-flow / postLogoutRedirectUris prerequisites. Registered in the sidebar under OIDC and added to the OAuth & OIDC index catalogue.
  • Sessions concept page: added an "Ending a Session" section explaining that app-side sign-out does not end the ThunderID session, and the two paths that do (redirect-based OIDC vs app-native Flow Execution API).
  • Build a Flow guide: added a "Build and configure a sign-out flow" section to Go Further, aligned with the existing registration/recovery sections (Sign Out flow type, Confirm & Sign Out template, End Session executor, assignment under the app's Flows tab).
  • Flow Execution API spec (api/flow-execution.yaml): added the SIGNOUT flow type to the flowType enum and a sign-out request example.

Approach

  • The new sequence diagram uses the repo's custom SequenceDiagram component (via a new RPInitiatedLogoutDiagram in OAuthFlowDiagrams.tsx), consistent with the other OAuth/OIDC pages, since Mermaid is not enabled in this repo.
  • Documented postLogoutRedirectUris as configured via declarative config / the /applications API, because no Console UI currently exposes that field.
  • Console-facing names are taken verbatim from the code (flow type "Sign Out", template "Confirm & Sign Out", executor node "End Session", app section "Sign Out").

Related Issues

  • N/A

Related PRs

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 support for initiating sign-out flows via the Flow Execution API using a new SIGNOUT flow type, including updated request examples.
    • Introduced the End Session executor to terminate the SSO session and clear its cookie.
    • Expanded logout support with OIDC RP-Initiated Logout, including correct browser return/redirect behavior.
  • Documentation

    • Updated guides for building, configuring, and assigning sign-out flows (including app-type logout differences).
    • Added and linked RP-Initiated Logout documentation, parameters/validation details, diagrams, and session-ending behavior guidance.

@madurangasiriwardena madurangasiriwardena added the skip-changelog Skip generating changelog for a particular PR label Jul 23, 2026
@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The PR documents RP-Initiated Logout, adds sign-out flow creation and session termination guidance, introduces a logout flow diagram, and expands the Flow Execution API to accept and demonstrate SIGNOUT requests.

Changes

Sign-out flow support

Layer / File(s) Summary
Flow Execution SIGNOUT contract
api/flow-execution.yaml
The InitialFlowRequest.flowType enum includes SIGNOUT, with a corresponding /flow/execute request example.
Session and sign-out flow guidance
docs/content/guides/flows/build-a-flow.mdx, docs/content/guides/flows/advanced-configurations.mdx, docs/content/key-concepts/authentication/sessions.mdx
Documentation describes creating and assigning sign-out flows, the End Session executor, session termination semantics, and OIDC versus app-native execution.
RP-Initiated Logout reference
docs/content/guides/protocols/oauth-oidc/*, docs/sidebars.ts, docs/src/components/OAuthFlowDiagrams.tsx
A new guide documents logout endpoints, parameters, validation, configuration, examples, redirects, and the associated navigation entry and sequence diagram.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Application
  participant OAuth2LogoutEndpoint
  participant SignOutFlow
  Application->>OAuth2LogoutEndpoint: Redirect to /oauth2/logout with logout parameters
  OAuth2LogoutEndpoint->>OAuth2LogoutEndpoint: Validate logout request
  OAuth2LogoutEndpoint->>SignOutFlow: Execute configured sign-out flow
  SignOutFlow-->>OAuth2LogoutEndpoint: Confirm session termination
  OAuth2LogoutEndpoint-->>Application: Redirect to post_logout_redirect_uri with state
Loading

Possibly related PRs

Suggested reviewers: donomalvindula, brionmario, rajithacharith, thamindudilshan, jeradrutnam

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: documenting session logout for OIDC and app-native flows.
Description check ✅ Passed The description matches the template with Purpose, Approach, Related Issues/PRs, Checklist, and Security sections.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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
🧪 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.

docs/content/guides/flows/advanced-configurations.mdx

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

docs/content/guides/flows/build-a-flow.mdx

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: 3

🧹 Nitpick comments (1)
docs/src/components/OAuthFlowDiagrams.tsx (1)

204-204: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Is this hardcoded brand name intentional?

Line [204] embeds ThunderID in the ariaLabel. If branding is configurable, derive the product name from the application/Docusaurus config and interpolate it into the string rather than hardcoding it.

As per path instructions, product names in docs/src should come from configuration instead of raw string literals.

🤖 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 `@docs/src/components/OAuthFlowDiagrams.tsx` at line 204, Replace the hardcoded
“ThunderID” in the RP-Initiated Logout diagram’s ariaLabel with the configured
product/application name, using the existing Docusaurus or application
configuration mechanism available to OAuthFlowDiagrams. Preserve the rest of the
accessibility text and interpolate the resolved name into the label.

Source: Path instructions

🤖 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 `@docs/content/guides/protocols/oauth-oidc/rp-initiated-logout.mdx`:
- Around line 40-43: Update the POST guidance in the endpoint request
documentation to avoid claiming it keeps id_token_hint out of server logs.
Describe POST as reducing query-string and browser-history exposure, and
recommend redacting id_token_hint because request bodies may still be logged by
applications, proxies, or middleware.
- Around line 21-22: The configured sign-out flow may prompt for confirmation or
use a Blank/custom flow, so make the logout documentation conditional rather
than guaranteeing a confirmation page. Update
docs/content/guides/protocols/oauth-oidc/rp-initiated-logout.mdx lines 21-22 and
101-105 to qualify the confirmation and result examples, and update
docs/src/components/OAuthFlowDiagrams.tsx lines 204-214 to remove or qualify
hard-coded confirmation steps.
- Line 22: Update the redirect behavior description in the RP-initiated logout
guide so it says <ProductName /> appends `state` only when the application
supplies it, rather than implying it is always appended. Apply the same
qualification to the related wording around the optional `state` parameter.

---

Nitpick comments:
In `@docs/src/components/OAuthFlowDiagrams.tsx`:
- Line 204: Replace the hardcoded “ThunderID” in the RP-Initiated Logout
diagram’s ariaLabel with the configured product/application name, using the
existing Docusaurus or application configuration mechanism available to
OAuthFlowDiagrams. Preserve the rest of the accessibility text and interpolate
the resolved name into the label.
🪄 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: 1bb4f451-8be7-4477-9110-4c54c9df5b94

📥 Commits

Reviewing files that changed from the base of the PR and between 99130c3 and 315f9a8.

📒 Files selected for processing (7)
  • api/flow-execution.yaml
  • docs/content/guides/flows/build-a-flow.mdx
  • docs/content/guides/protocols/oauth-oidc/index.mdx
  • docs/content/guides/protocols/oauth-oidc/rp-initiated-logout.mdx
  • docs/content/key-concepts/authentication/sessions.mdx
  • docs/sidebars.ts
  • docs/src/components/OAuthFlowDiagrams.tsx

Comment thread docs/content/guides/protocols/oauth-oidc/rp-initiated-logout.mdx Outdated
Comment thread docs/content/guides/protocols/oauth-oidc/rp-initiated-logout.mdx Outdated
Comment thread docs/content/guides/protocols/oauth-oidc/rp-initiated-logout.mdx Outdated
@codecov

codecov Bot commented Jul 23, 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 the trigger-pr-builder Add when the PR is ready for CI; starts the PR Builder for this and all later pushes label Jul 24, 2026
@madurangasiriwardena
madurangasiriwardena force-pushed the document-session-logout branch 2 times, most recently from 9c05e32 to ec53a5d Compare July 24, 2026 04:56
@Malith-19 Malith-19 added documentation Improvements or additions to documentation Type/Docs labels Jul 24, 2026
Add an RP-Initiated Logout page under the OAuth & OIDC protocol guides
covering the end_session_endpoint, register it in the sidebar and the
protocol catalogue, describe session termination in the Sessions concept
page, add a sign-out flow section to the Build a Flow guide, and add the
SIGNOUT flow type to the Flow Execution API spec.

@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.

🧹 Nitpick comments (1)
docs/content/guides/flows/advanced-configurations.mdx (1)

385-385: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Clarify that the executor clears the per-flow cookie.

The implementation terminates the SSO session and signals the transport layer to clear the per-flow handle cookie. Replace “its session cookie” with “the per-flow cookie” to avoid implying that the SSO session itself is represented by that cookie.

Proposed wording
-| **End Session** | Terminates the SSO session established by the authentication flow and clears its session cookie. | - |
+| **End Session** | Terminates the SSO session established by the authentication flow and clears the per-flow cookie. | - |
🤖 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 `@docs/content/guides/flows/advanced-configurations.mdx` at line 385, Update
the “End Session” table entry to replace “its session cookie” with “the per-flow
cookie,” clarifying that the executor signals transport-layer cleanup of the
per-flow handle cookie while terminating the SSO session.
🤖 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.

Nitpick comments:
In `@docs/content/guides/flows/advanced-configurations.mdx`:
- Line 385: Update the “End Session” table entry to replace “its session cookie”
with “the per-flow cookie,” clarifying that the executor signals transport-layer
cleanup of the per-flow handle cookie while terminating the SSO session.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: ee61cd6c-7729-4cfd-83f0-31fcc029a979

📥 Commits

Reviewing files that changed from the base of the PR and between 27a9480 and d6bb0c9.

📒 Files selected for processing (3)
  • api/flow-execution.yaml
  • docs/content/guides/flows/advanced-configurations.mdx
  • docs/content/guides/flows/build-a-flow.mdx
🚧 Files skipped from review as they are similar to previous changes (2)
  • api/flow-execution.yaml
  • docs/content/guides/flows/build-a-flow.mdx

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

Labels

documentation Improvements or additions to documentation skip-changelog Skip generating changelog for a particular PR trigger-pr-builder Add when the PR is ready for CI; starts the PR Builder for this and all later pushes Type/Docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants