Light-Auth Documentation

Light-Auth is a lightweight, secure authentication framework designed for modern web applications.

Overview

Light-Auth provides a simple, yet powerful authentication solution that can be integrated into any web application. It offers features like JWT-based authentication, multi-factor authentication, and social login integration.

Key Features

Secure by Design
Built with security best practices from the ground up
  • HTTP-only cookies for session storage
  • Server-side credential handling
  • CSRF protection built-in
Automatic Token Refresh
Seamless token management without user interruption
  • Proactive refresh before token expiration
  • Transparent background refreshing
  • No additional code required
Multiple OAuth Providers
Support for all major authentication providers
  • Google, Microsoft, GitHub, and more
  • Consistent API across providers
  • Easy to add custom providers
Framework Integration
Seamless integration with modern web frameworks
  • Next.js App Router and Pages Router
  • Astro, Nuxt.js, SvelteKit
  • Framework-specific adapters
Lightweight & Flexible
Minimal dependencies with maximum flexibility
  • Small bundle size
  • Customizable user adapters
  • Extensible architecture
Developer Experience
Built with developer productivity in mind
  • TypeScript-first design
  • Intuitive API design
  • Comprehensive documentation

SSR Requirements

Light-Auth is designed exclusively for server-side rendering frameworks to ensure secure authentication flows and proper credential handling.

Important Notice

For security reasons, Light-Auth requires a server-side environment to:

  • Securely store OAuth client secrets
  • Handle HTTP-only cookies for session management
  • Process OAuth callbacks and token exchanges
  • Perform secure token refresh operations
Supported Frameworks
Light-Auth works with these server-side rendering frameworks
  • Next.js

    Next.js

    Full support for both App Router and Pages Router

  • Astro

    Astro

    Compatible when SSR mode is enabled

  • Nuxt.js

    Nuxt.js

    Vue-based SSR framework support

  • Sveltekit

    Sveltekit

    Svelte-based SSR framework support

  • Express

    Express

    Node.js web application framework

Not Compatible With
Light-Auth cannot be used with these client-side only frameworks
  • React with Vite

    Client-side only React applications

  • Create React App

    CRA-based applications without a server

  • Vue with Vite

    Client-side only Vue applications

  • Static Site Generators

    Pre-rendered static sites without SSR

A version of light-auth is currently in development for client-side only applications, with providers compatible with the PCKSE protocol.

Getting Started

To get started with Light-Auth, check out the Getting Started guide.