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.

We value your privacy

This website uses cookies for anonymous analytics to help us improve your experience. No personal information is stored or shared. You can allow or reject analytics tracking at any time. See our Privacy Policy.

We use cookies for anonymous analytics. No personal info is stored. See our Privacy Policy.