Skip to content

Sample apps

Three sample apps ship in the IntelliAuth repo. Each is intentionally small (one component, one route, one feature) so you can clone, run, and read the code in 15 minutes total.

A minimal Vite + React app that demonstrates the authorization code with PKCE flow end-to-end. Single page; click Sign in, redirect to IntelliAuth, redirect back signed in, see your profile.

What it covers:

  • IntelliAuthProvider setup.
  • useIntelliAuth() for state.
  • loginWithRedirect() + logout().
  • The /callback route that completes the code exchange.

What it skips:

  • Routing (single page).
  • API calls (no backend).
  • Styling (intentionally plain so the auth flow is the focus).

Best as your first read.

sample-app-2 — Multi-route React with API calls

Section titled “sample-app-2 — Multi-route React with API calls”

The same React SDK setup, but expanded into a multi-route app that calls a protected backend API. Demonstrates:

  • React Router with public + protected routes.
  • getAccessToken() for outbound calls.
  • A small Node + Express backend using requireSession middleware.
  • Graceful handling of session_expired (redirect to login) and network_error (toast + retry).

Run both the frontend (Vite) and the backend (Express) locally; the frontend sends authenticated requests to the backend.

sample-saml-app — SAML federation with Passport

Section titled “sample-saml-app — SAML federation with Passport”

An Express app that federates authentication through IntelliAuth's SAML SP capability. Useful when your application has to plug into the enterprise SSO of an organisation that already runs Okta, Entra, or OneLogin and demands SAML.

What it covers:

  • IntelliAuth tenant configured as a SAML SP.
  • Express + Passport SAML strategy.
  • The IdP-initiated and SP-initiated flows.
  • ACS URL configuration.
  • Attribute mapping (email, name, groups).

Smallest of the three; most useful when you specifically need SAML rather than OAuth/OIDC.

All three live in the IntelliAuth public examples repo. Clone the one you want and follow the per-app README:

Terminal window
git clone https://github.com/intelliauth-co/examples.git intelliauth-examples
cd intelliauth-examples/sample-app
cp .env.example .env
# edit .env: set INTELLIAUTH_TENANT_URL + INTELLIAUTH_CLIENT_ID
pnpm install
pnpm dev

Each app's README walks the specific setup (which tenant settings to flip, which application type to register, etc.).

If your shape is genuinely unusual (a non-React framework, a server-rendered app, a backend in a language other than Node), the sample apps are still useful as protocol-level reference. The HTTP flows are the same regardless of language; SDKs are conveniences. The API reference documents every endpoint the samples hit.