import { type HttpClient, HttpClientError } from "./http_client.js"; import type { JwtVerifier } from "./jwt_verifier.js"; import type { AccessTokenResponse, AccessTokenResponseOptions, AuthRequestUriOptions, GetUserProfileFromIdTokenOptions, OAuth, UserProfile } from "./oauth.js"; import { OAuthError } from "./oauth_error.js"; import type { OidcIdTokenClaims } from "./oidc.js"; export interface OAuth2Options { clientId: string; clientSecret?: string | (() => Promise); redirectUri: string; scope?: string[] | string; httpClient?: HttpClient; jwtVerifier?: JwtVerifier; } export declare abstract class OAuth20 implements OAuth { options: OAuth2Options; httpClient: HttpClient; jwtVerifier: JwtVerifier; abstract authRequestUri: string; abstract accessTokenRequestUri: string; abstract userProfileUri: string; jwksUri: string | null; jwtIssuer: string | null; requestAccessTokenMethod: "get" | "x-www-form-urlencoded"; scopes: string[]; scopeSeparator: string; constructor(options: OAuth2Options); buildScopes(scopes: string[]): string; getAuthRequestFields(options?: AuthRequestUriOptions): Record; /** * @see https://tools.ietf.org/html/rfc6749#section-4.1.1 */ getAuthRequestUri(options?: AuthRequestUriOptions): Promise; getAccessTokenFields(code: string, options?: AccessTokenResponseOptions): Promise>; createErrorFromHttpClientError(e: HttpClientError): OAuthError; /** * @see https://tools.ietf.org/html/rfc6749#section-2.3.1 * @see https://tools.ietf.org/html/rfc6749#section-4.1.3 */ requestAccessToken(code: string, options?: AccessTokenResponseOptions): Promise>; /** * @see https://tools.ietf.org/html/rfc6749#section-4.1.4 */ mapDataToAccessTokenResponse(data: Record): AccessTokenResponse; getAccessTokenResponse(code: string, options?: AccessTokenResponseOptions): Promise; abstract mapDataToUserProfile(data: unknown): UserProfile; getUserProfile(accessToken: string): Promise; mapOidcIdTokenClaimsToUserProfile(data: OidcIdTokenClaims): UserProfile; getUserProfileFromIdToken(idToken: string, options?: GetUserProfileFromIdTokenOptions): Promise; } //# sourceMappingURL=oauth20.d.ts.map