Part of ssowhat.dev — interactive SSO protocol visualizations.
Reusable Svelte 5 components for building step-by-step authentication flow demos. Each demo shows the same application protected by a different SSO architecture, with full HTTP transcript visibility.
-
Copy the template:
cp -r src/lib/sso-demos/_template \ src/lib/sso-demos/your-demo-name -
Update imports in
demo.svelte:<script lang="ts"> import SSODemoShell from '$lib/sso-demos/shared/SSODemoShell.svelte'; import { Blank, Loading, Dashboard } from '$lib/sso-demos/screens/ots'; </script>
-
Customize your demo:
config.ts- Define actors, protocol stack, and metadatasteps.ts- Define the authentication flow stepsdemo.svelte- Wire up screens and export the component
-
Create a SvelteKit route:
src/routes/your-demo-name/ └── +page.svelte<script lang="ts"> import YourDemo from '$lib/sso-demos/your-demo-name/demo.svelte'; </script> <svelte:head> <title>Your Demo Title</title> </svelte:head> <YourDemo />
| Component | Description |
|---|---|
SSODemoShell |
Main orchestrator with navigation, keyboard controls, autoplay |
HttpEntry |
HTTP message display with expandable payloads |
ActorDiagram |
Horizontal actor indicator strip |
ProtocolStack |
Protocol stack visualization |
BrowserMockup |
Browser chrome wrapper |
| Screen | Key | Description |
|---|---|---|
Blank |
blank |
Initial redirect state ("Redirecting to login...") |
Loading |
loading |
Processing state (spinner) |
Dashboard |
dashboard |
Authenticated OTS dashboard |
| Screen | Key | Description |
|---|---|---|
LogtoSignIn |
logto-signin |
Logto OIDC provider login |
EntraLogin |
entra-login |
Microsoft Entra ID login |
EntraAutoSubmit |
entra-autosubmit |
Entra SAML auto-submit |
OktaLogin |
okta-login |
Okta login page |
Auth0Universal |
auth0-universal |
Auth0 Universal Login |
GoogleOAuth |
google-oauth |
Google OAuth consent |
KeycloakLogin |
keycloak-login |
Keycloak login page |
interface Step {
id: number; // Step number displayed in UI
title: string; // Short title
userSees: string; // Key into screens map
urlBar: string; // URL in browser mockup
description: string; // Detailed explanation
securityNote?: string; // Optional security tip
http: HttpMessage[]; // HTTP messages in this step
actors: Record<string, boolean>; // Which actors are active
}interface HttpMessage {
type: "request" | "response" | "internal" | "server" | "server-response";
from: string;
to: string;
method?: string; // GET, POST, etc.
url?: string;
headers?: string[];
body?: string;
note?: string; // Explanatory note
status?: string; // HTTP status (responses)
label?: string; // Label (internal processes)
expandedPayload?: { // Decoded content (SAML, JWT)
label: string;
content: string;
};
}interface DemoConfig {
title: string; // Demo title
subtitle: string; // Description
version: string; // Semantic version
backLink: { href: string; label: string };
actorConfig: ActorConfig[]; // Actor definitions
protocolStack: ProtocolStackConfig;
}interface ActorConfig {
key: string; // Unique identifier
label: string; // Display name
activeColor: string; // Tailwind bg color (e.g., "bg-blue-500")
}| Key | Action |
|---|---|
ArrowLeft |
Previous step |
ArrowRight |
Next step |
Space |
Toggle autoplay |
T |
Toggle transcript view |
R |
Restart demo |
1 / 2 / 3 |
Playback speed (slow / normal / fast) |
-
Create the component in
screens/idp/:<!-- YourIdPLogin.svelte --> <div class="flex h-full items-center justify-center bg-slate-900"> <!-- Your IdP login mockup --> </div>
-
Export from
screens/idp/index.ts:export { default as YourIdPLogin } from './YourIdPLogin.svelte';
-
Re-export from
index.ts:export { YourIdPLogin } from './screens/idp/index.js';
sso-demos/
├── _template/ # Copy to create new demos
│ ├── config.ts
│ ├── demo.svelte
│ └── steps.ts
├── screens/
│ ├── ots/ # OTS app screens (constant)
│ │ ├── Blank.svelte
│ │ ├── Dashboard.svelte
│ │ └── Loading.svelte
│ └── idp/ # IdP screens (pick per demo)
│ ├── EntraAutoSubmit.svelte
│ ├── EntraLogin.svelte
│ ├── LogtoSignIn.svelte
│ └── ...
├── shared/
│ ├── ActorDiagram.svelte
│ ├── BrowserMockup.svelte
│ ├── HttpEntry.svelte
│ ├── ProtocolStack.svelte
│ ├── SSODemoShell.svelte
│ ├── StepArticle.svelte
│ └── TranscriptView.svelte
├── types.ts
└── index.ts