Skip to content

Latest commit

 

History

History

auth_samples_react

README.md

Tuurio Auth React Demo

A React + Vite demo that signs in with OAuth 2.0 / OpenID Connect, then displays token contents and a logout button.

Integration guide

Setup

  1. Install dependencies:
npm install
  1. Provision a tenant-specific public client through the human-approved browser handoff:
npx manage-tuurio-id@1.1.6 init --framework react --project-dir . --auth browser --yes --output json --campaign github_react_vite --no-open --no-wait
  1. Start the development server after the CLI writes the ignored local configuration:
npm run dev

Open http://localhost:5173.

Required client URLs

Configure your Tuurio client with these redirect URLs (matching your .env values):

Redirect URI: http://localhost:5173/auth/callback
Post-logout Redirect URI: http://localhost:5173/logout/callback

The demo also accepts /callback for compatibility.

.env keys

VITE_TUURIO_ISSUER=https://your-tenant.id.tuurio.com
VITE_TUURIO_CLIENT_ID=replace-with-your-public-client-id
VITE_TUURIO_REDIRECT_URI=http://localhost:5173/auth/callback
VITE_TUURIO_POST_LOGOUT_REDIRECT_URI=http://localhost:5173/logout/callback
VITE_TUURIO_SCOPE=openid profile email

Notes:

  • This is a public SPA client. Do not use or commit confidential client secrets.
  • Keep redirect URIs and post-logout URIs exact.