RegisterLogin
DocsPricing
RegisterLogin
  • Getting Started
  • Introduction
  • Quick Start
  • SDKs
  • React
  • TypeScript
  • Next.js
  • Express
  • NestJS
  • Python
  • API Reference
  • Support and Resources
  • FAQ
  • Contact

Route Handlers

Pre-built handlers for OAuth authentication flow in Express.js applications.


Overview

AuthSafe provides ready-to-use route handlers for all OAuth 2.1 flows: handleSignIn() to initiate sign in, handleCallback() to process the OAuth callback, handleLogout() to sign out, and handleRefresh() to refresh access tokens.


Basic Usage

import { handleSignIn, handleCallback, handleLogout } from 'authsafe-express';

app.get('/auth/signin', (req, res) => {
  handleSignIn(req, res, config);
});

app.get('/auth/callback', (req, res) => {
  handleCallback(req, res, config);
});

app.get('/auth/logout', (req, res) => {
  handleLogout(req, res, config);
});

Best Practices
  • handleSignIn() generates PKCE code challenge, nonce, and state parameter
  • handleCallback() requires clientSecret for token exchange
  • Use returnTo query parameter to specify redirect destination after sign in

AuthSafe

Product

HighlightFeatureIntegrationPricingFAQ

Company

AboutBlogContact

Developer

DashboardDocumentation

Legal

Terms & ConditionsPrivacyComplianceShippingCancellationAI

© 2026 AuthSafe. All rights reserved.

Valoramos su privacidad

Este sitio web utiliza cookies para análisis anónimos que nos ayudan a mejorar su experiencia. No se almacena ni comparte información personal. Puede permitir o rechazar el seguimiento analítico en cualquier momento. Consulte nuestra Política de Privacidad.

Usamos cookies para análisis anónimos. No se almacena información personal. Consulte nuestra Política de Privacidad.