OAuthService
Hauptdienst für OAuth 2.1 und OpenID Connect Authentifizierungsflows.
Überblick
Der OAuthService verwaltet den vollständigen OAuth 2.1- und OIDC-Authentifizierungslebenszyklus mit automatischem PKCE, Statusvalidierung, Nonce-Behandlung und Token-Aktualisierung. Er umhüllt die branchenübliche oidc-client-ts-Bibliothek mit AuthSafe-spezifischer Konfiguration.
Grundlegende Verwendung
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();