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

OAuthService

Main service for OAuth 2.1 and OpenID Connect authentication flows.


Overview

The OAuthService manages the complete OAuth 2.1 and OIDC authentication lifecycle with automatic PKCE, state validation, nonce handling, and token refresh. It wraps the industry-standard oidc-client-ts library with AuthSafe-specific configuration.


Basic Usage

import { OAuthService } from 'authsafe-ts';

const oauthService = new OAuthService({
  clientId: 'your-client-id',
  redirectUri: 'http://localhost:3000/callback',
  scope: ['openid', 'profile', 'email', 'offline_access'],
  env: 'production',
});

await oauthService.initialize();

Best Practices
  • clientId is required — get it from the AuthSafe dashboard
  • redirectUri must match the callback URL registered in your AuthSafe app
  • Always include 'openid' scope for OIDC compliance

AuthSafe

Product

HighlightFeatureIntegrationPricingFAQ

Company

AboutBlogContact

Developer

DashboardDocumentation

Legal

Terms & ConditionsPrivacyComplianceShippingCancellationAI

© 2026 AuthSafe. All rights reserved.

Nous respectons votre vie privée

Ce site utilise des cookies pour des analyses anonymes afin d'améliorer votre expérience. Aucune information personnelle n'est stockée ni partagée. Vous pouvez autoriser ou refuser le suivi analytique à tout moment. Consultez notre Politique de Confidentialité.

Nous utilisons des cookies pour des analyses anonymes. Aucune donnée personnelle n'est stockée. Consultez notre Politique de Confidentialité.