Skip to content

Add Single Sign-On documentation - #3918

Merged
madurangasiriwardena merged 1 commit into
thunder-id:mainfrom
madurangasiriwardena:docs/single-sign-on
Jul 20, 2026
Merged

Add Single Sign-On documentation#3918
madurangasiriwardena merged 1 commit into
thunder-id:mainfrom
madurangasiriwardena:docs/single-sign-on

Conversation

@madurangasiriwardena

@madurangasiriwardena madurangasiriwardena commented Jul 11, 2026

Copy link
Copy Markdown
Member

Purpose

Document flow-centric browser Single Sign-On (SSO) introduced in #3779. Adds user-facing documentation for the feature: how flow SSO works, the two SSO nodes, checkpoints, session lifetime configuration, and the session cookie. Documentation only; no product code changes.

Approach

Two new pages plus supporting docs infrastructure:

  • Guideguides/guides/flows/single-sign-on.mdx (Single Sign-On for Flows): explains the flow-centric model, describes the Check SSO Session and Save / Load Session nodes (with their TASK_EXECUTION / SSOCheckExecutor / SessionExecutor identifiers inline, matching the convention in the other flow docs), walks through adding SSO to a flow, and covers session lifetime and the tid_sso_<hash> cookie.
  • Key conceptguides/key-concepts/authentication/sessions.mdx (Sessions and Single Sign-On): the underlying session model, checkpoints, flow-centric grouping (including grouping by security category), lifetime, and browser scope.
  • Diagram componentdocs/src/components/SsoFlowDiagram.tsx: a hand-built SVG flow diagram reusing the existing fnd-* classes in custom.css (the same pattern as FlowNodeDiagram), rather than Mermaid, which is not enabled in the docs site.
  • Sidebar — added both pages to docs/sidebars.ts.
  • Vale — added Sign-On to the title-case exceptions (alongside Sign-In/Sign-Out/Sign-Up) and [Ss]kippable to the accepted vocabulary. Both pages pass Vale with zero errors and warnings.

A checkpoint is described as the pair of nodes (Check SSO Session + Save / Load Session) and the group of authentication steps encapsulated between them.

Related Issues

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

  • Documentation
    • Added guides explaining Sessions and Single Sign-On for browser-based flows.
    • Documented session checkpoints, sign-in behavior, timeout settings, and browser cookie handling.
    • Added a visual flow diagram for configuring SSO.
    • Added both guides to the documentation navigation.
    • Clarified that flow SSO is currently limited to browser authentication.

@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Adds documentation for flow-scoped SSO sessions, checkpoints, cookies, configuration, and browser limitations, plus an accessible flow diagram and navigation entries.

Changes

Flow SSO documentation

Layer / File(s) Summary
Session and SSO concepts
docs/content/guides/key-concepts/authentication/sessions.mdx
Defines flow-scoped sessions, checkpoint reuse and expiry, browser cookies, and session lifetime settings.
Flow SSO guide and visualization
docs/content/guides/guides/flows/single-sign-on.mdx, docs/src/components/SsoFlowDiagram.tsx
Documents SSO node wiring, sign-in behavior, configuration, cookie attributes, and browser scope, and adds an accessible inline SVG flow diagram.
Documentation navigation and authoring support
docs/sidebars.ts, .vale/styles/ThunderID/TitleCaseTitles.yml
Adds both pages to the documentation sidebar and permits “Sign-On” in H1 headings.

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

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title clearly summarizes the main change: adding Single Sign-On documentation.
Description check ✅ Passed The description covers Purpose, Approach, Related Issues, Related PRs, checklist, and security checks, matching the template well.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

🤖 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/guides/flows/single-sign-on.mdx`:
- Around line 100-102: Update the “Current Scope and Limitations” section in the
SSO guide to explicitly state that multi-checkpoint and step-up authentication
scenarios are not currently supported, alongside the existing browser-based
limitation.
- Line 79: Update the session timeout documentation to reference the actual
session resource path used by the repository, replacing both nonexistent
source-checkout and packaged-distribution paths. Keep the existing guidance for
idleTimeoutSeconds, absoluteTimeoutSeconds, and duration semantics unchanged.

In `@docs/src/components/SsoFlowDiagram.tsx`:
- Around line 21-109: Replace the hand-built SVG in SsoSingleStepDiagram with an
inline Mermaid flowchart in single-sign-on.mdx, preserving the Start, Check SSO
Session, labeled Skip to and Authenticate branches, credential-authentication
path, convergence at Save / Load Session, and final Auth Assertion Generator →
End flow. Remove the SsoSingleStepDiagram component and its import after
updating the MDX usage.
🪄 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: 725ba665-4522-423d-9655-cf306c29c638

📥 Commits

Reviewing files that changed from the base of the PR and between d946d34 and 0cbe7d7.

📒 Files selected for processing (6)
  • .vale/styles/WSO2-IAM/TitleCaseTitles.yml
  • .vale/styles/config/vocabularies/vocab/accept.txt
  • docs/content/guides/guides/flows/single-sign-on.mdx
  • docs/content/guides/key-concepts/authentication/sessions.mdx
  • docs/sidebars.ts
  • docs/src/components/SsoFlowDiagram.tsx

Comment thread docs/content/guides/guides/flows/single-sign-on.mdx
Comment on lines +100 to +102
## Current Scope and Limitations

- Flow SSO applies to **browser-based** authentication, because it relies on the cookies.

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 | 🟡 Minor | ⚡ Quick win

Add multi-checkpoint and step-up limitations.

The "Current Scope and Limitations" section lists only the browser-based constraint. The PR objectives note that multi-checkpoint and step-up scenarios are not yet supported. Adding these to the limitations section sets reader expectations and prevents confusion.

📝 Suggested addition
 ## Current Scope and Limitations
 
 - Flow SSO applies to **browser-based** authentication, because it relies on the cookies.
+- Each flow supports a single checkpoint. Multi-checkpoint and step-up authentication scenarios are not yet supported.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
## Current Scope and Limitations
- Flow SSO applies to **browser-based** authentication, because it relies on the cookies.
## Current Scope and Limitations
- Flow SSO applies to **browser-based** authentication, because it relies on the cookies.
- Each flow supports a single checkpoint. Multi-checkpoint and step-up authentication scenarios are not yet supported.
🤖 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/guides/flows/single-sign-on.mdx` around lines 100 - 102,
Update the “Current Scope and Limitations” section in the SSO guide to
explicitly state that multi-checkpoint and step-up authentication scenarios are
not currently supported, alongside the existing browser-based limitation.

Comment on lines +21 to +109
export function SsoSingleStepDiagram(): React.ReactElement {
return (
<figure
className="flow-node-diagram"
role="img"
aria-label="Single-step Single Sign-On flow: Start leads to Check SSO Session. The Skip to path goes straight to Save / Load Session; the Authenticate path goes through Collect Credentials and Credentials Auth before reaching Save / Load Session. Save / Load Session then leads to Auth Assertion Generator and End."
>
<svg
viewBox="0 0 910 180"
style={{width: '100%', overflow: 'visible', display: 'block', fontFamily: 'inherit'}}
aria-hidden="true"
>
<defs>
<marker id="sso1-arr" markerWidth="8" markerHeight="6" refX="7" refY="3" orient="auto">
<polygon points="0 0, 8 3, 0 6" style={{fill: 'context-stroke'}} />
</marker>
</defs>

{/* ── Nodes ──────────────────────────────────────────────────── */}
<rect x="12" y="33" width="60" height="34" rx="17" className="fnd-node fnd-node--start" />
<text x="42" y="50" textAnchor="middle" dominantBaseline="central" className="fnd-label fnd-label--light">
Start
</text>

<rect x="96" y="28" width="132" height="44" rx="8" className="fnd-node fnd-node--task" />
<text x="162" y="50" textAnchor="middle" dominantBaseline="central" className="fnd-label">
Check SSO Session
</text>

<rect x="470" y="28" width="140" height="44" rx="8" className="fnd-node fnd-node--task" />
<text x="540" y="50" textAnchor="middle" dominantBaseline="central" className="fnd-label">
Save / Load Session
</text>

<rect x="648" y="28" width="150" height="44" rx="8" className="fnd-node fnd-node--task" />
<text x="723" y="44" textAnchor="middle" dominantBaseline="central" className="fnd-label">
Auth Assertion
</text>
<text x="723" y="58" textAnchor="middle" dominantBaseline="central" className="fnd-label">
Generator
</text>

<rect x="832" y="33" width="60" height="34" rx="17" className="fnd-node fnd-node--end" />
<text x="862" y="50" textAnchor="middle" dominantBaseline="central" className="fnd-label fnd-label--light">
End
</text>

<rect x="250" y="120" width="140" height="40" rx="6" className="fnd-node fnd-node--prompt" />
<text x="320" y="140" textAnchor="middle" dominantBaseline="central" className="fnd-label">
Collect Credentials
</text>

<rect x="410" y="120" width="120" height="40" rx="6" className="fnd-node fnd-node--task" />
<text x="470" y="140" textAnchor="middle" dominantBaseline="central" className="fnd-label">
Credentials Auth
</text>

{/* ── Arrows ─────────────────────────────────────────────────── */}
<line x1="72" y1="50" x2="92" y2="50" className="fnd-edge" markerEnd="url(#sso1-arr)" />

{/* Check → Save (Skip to) */}
<line x1="228" y1="50" x2="466" y2="50" className="fnd-edge fnd-edge--success" markerEnd="url(#sso1-arr)" />

{/* Check → Collect Credentials (Authenticate) */}
<path d="M 162,72 V 140 H 246" className="fnd-edge fnd-edge--failure" markerEnd="url(#sso1-arr)" />

{/* Collect Credentials → Credentials Auth */}
<line x1="390" y1="140" x2="406" y2="140" className="fnd-edge" markerEnd="url(#sso1-arr)" />

{/* Credentials Auth → Save (rejoin) */}
<path d="M 530,140 H 540 V 74" className="fnd-edge" markerEnd="url(#sso1-arr)" />

{/* Save → Auth Assertion Generator */}
<line x1="610" y1="50" x2="644" y2="50" className="fnd-edge" markerEnd="url(#sso1-arr)" />

{/* Auth Assertion Generator → End */}
<line x1="798" y1="50" x2="828" y2="50" className="fnd-edge" markerEnd="url(#sso1-arr)" />

{/* ── Edge labels ────────────────────────────────────────────── */}
<text x="347" y="42" textAnchor="middle" dominantBaseline="central" className="fnd-edge-label fnd-edge-label--success">
Skip to
</text>
<text x="170" y="104" dominantBaseline="central" className="fnd-edge-label fnd-edge-label--failure">
Authenticate
</text>
</svg>
</figure>
);
}

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

Use Mermaid instead of hand-built SVG for the flow diagram.

Both the coding guidelines ("Use Mermaid for architecture, flow, sequence, and similar diagrams; do not hand-build diagrams with raw SVG or ASCII art unless Mermaid cannot express the required layout") and the path instructions ("Flag hand-built SVG diagrams... as a major issue") require Mermaid for flow diagrams. This is a standard flowchart with a decision point, two labeled branches, and convergence — Mermaid's flowchart handles this directly.

Secondary concerns resolved by switching to Mermaid:

  • Inline style={{...}} props on lines 30 and 35 violate the sx prop requirement.
  • className-based styling throughout would no longer be needed.
  • fill: 'context-stroke' on line 35 has limited browser support (not in Firefox).
  • The entire component file and its import in single-sign-on.mdx line 8 can be eliminated.

As per coding guidelines, use Mermaid for architecture, flow, sequence, and similar diagrams; do not hand-build diagrams with raw SVG or ASCII art unless Mermaid cannot express the required layout. As per path instructions, flag hand-built SVG diagrams as a major issue and ask whether Mermaid should be used instead.

♻️ Proposed Mermaid replacement

Replace the <SsoSingleStepDiagram /> usage in single-sign-on.mdx with an inline Mermaid block and delete SsoFlowDiagram.tsx:

-import {SsoSingleStepDiagram} from '../../../../src/components/SsoFlowDiagram';
-
 # Single Sign-On for Flows
-<SsoSingleStepDiagram />
+```mermaid
+flowchart LR
+    Start([Start]) --> Check[Check SSO Session]
+    Check -->|Skip to| Save[Save / Load Session]
+    Check -->|Authenticate| Collect[Collect Credentials]
+    Collect --> Auth[Credentials Auth]
+    Auth --> Save
+    Save --> AAG[Auth Assertion Generator]
+    AAG --> End([End]
+```
🤖 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/SsoFlowDiagram.tsx` around lines 21 - 109, Replace the
hand-built SVG in SsoSingleStepDiagram with an inline Mermaid flowchart in
single-sign-on.mdx, preserving the Start, Check SSO Session, labeled Skip to and
Authenticate branches, credential-authentication path, convergence at Save /
Load Session, and final Auth Assertion Generator → End flow. Remove the
SsoSingleStepDiagram component and its import after updating the MDX usage.

Sources: Coding guidelines, Path instructions

@codecov

codecov Bot commented Jul 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Add a guide (Single Sign-On for Flows) and a key-concept page (Sessions
and Single Sign-On) covering flow-centric SSO, the Check SSO Session and
Save / Load Session nodes, checkpoints, session lifetime, and the session
cookie. Add an SsoSingleStepDiagram component for the flow diagram, wire
both pages into the sidebar, and extend the Vale title-case exceptions and
vocabulary.

To build this flow:

1. Open the flow in the **Console Flow Builder**.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This might be revisited with @DonOmalVindula 's work. Tagging for reference

@ThaminduDilshan ThaminduDilshan added the skip-changelog Skip generating changelog for a particular PR label Jul 20, 2026
@madurangasiriwardena
madurangasiriwardena added this pull request to the merge queue Jul 20, 2026
Merged via the queue into thunder-id:main with commit 045a7ac Jul 20, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-changelog Skip generating changelog for a particular PR Type/Docs Type/New Feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants