@glamtime/oauth-oidc-client
Version:
Secure your Angular app using the latest standards for OpenID Connect & OAuth2. Provides support for token refresh, all modern OIDC Identity Providers and more.
39 lines (38 loc) • 1.85 kB
TypeScript
import { NgZone } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { BehaviorSubject, Observable } from 'rxjs';
import { OpenIDConfiguration } from './models/openid-configuration.model';
import { OAuthOptions } from './models/options.model';
import { TokenResponse } from './models/token-response.model';
import { OAuthStorageService } from './storages/oauth-storage.service';
import { OAuthCryptoService } from "./crypto/oauth-crypto.service";
import * as i0 from "@angular/core";
export declare const OAUTH_WELL_KNOWN_SUFFIX = "/.well-known/openid-configuration";
export declare class OAuthService {
protected _zone: NgZone;
protected _httpClient: HttpClient;
private _storageService;
private _cryptoService;
private _document;
private readonly _platformId;
private readonly _config;
private _openIDConfiguration;
private _jwtKeys;
private _userInfo;
readonly authenticated$: BehaviorSubject<boolean>;
constructor(_zone: NgZone, _httpClient: HttpClient, _storageService: OAuthStorageService, _cryptoService: OAuthCryptoService, _document: any, _platformId: string, config: OAuthOptions);
get accessToken(): string | null;
get resourceServers(): string[];
checkAuth(): Observable<any>;
login(): Observable<boolean>;
logout(): Observable<any>;
protected _fetchOpenIdConfiguration(): Observable<OpenIDConfiguration>;
protected _fetchToken(authorizationCode: string): Observable<TokenResponse>;
protected _fetchRefreshToken(): Observable<any>;
private _fetchUserProfile;
protected _createLoginUrl(codeChallenge: string): string;
private _redirectTo;
protected _encodeClientCredentials(): string;
static ɵfac: i0.ɵɵFactoryDeclaration<OAuthService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<OAuthService>;
}