Skip to content

Repository files navigation

Tachyon Auth Sample

A sample Next.js application demonstrating OAuth2/OIDC integration with Tachyon Auth Platform.

Features

  • OAuth2 Authorization Code flow with PKCE
  • Token exchange via server-side API route (client secret never exposed to browser)
  • UserInfo endpoint integration
  • Token revocation on logout

Setup

  1. Register an OAuth2 Client on Tachyon Auth Platform:

  2. Configure environment variables:

    cp .env.example .env
    # Edit .env with your OAuth2 client credentials
  3. Run locally:

    npm install
    npm run dev
  4. Deploy to Tachyon Compute:

    • Push to GitHub
    • Create a Cloud App on Tachyon Compute pointing to this repo
    • Set environment variables in the app configuration

OAuth2 Flow

Browser                    This App (Next.js)           Tachyon Auth Platform
  |                              |                              |
  |-- Click "Sign in" --------->|                              |
  |                              |-- Generate PKCE verifier    |
  |<-- Redirect to /oauth2/authorize ----------------------->|
  |                              |                              |
  |                              |           (User authenticates & consents)
  |                              |                              |
  |<-- Redirect to /callback with code ----------------------|
  |                              |                              |
  |-- POST /api/auth/token ----->|                              |
  |                              |-- POST /oauth2/token ------>|
  |                              |<-- access_token, id_token --|
  |<-- Token response -----------|                              |
  |                              |                              |
  |-- GET /oauth2/userinfo (via browser) -------------------->|
  |<-- User profile ------------------------------------------|

Tech Stack

  • Next.js 15 (App Router)
  • OAuth2 with PKCE (RFC 7636)
  • Tachyon Auth Platform as OAuth2/OIDC Provider

Retrigger marker: D1 token permission fixed (2026-07-16)

retrigger 2

retrigger 3

retrigger 4: after credential fix + api rollout

retrigger 5: runtime binding attached

About

Tachyon Auth Platform sample app - OAuth2/OIDC integration example

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages