@atproto/oauth-client
Version:
OAuth client for ATPROTO PDS. This package serves as common base for environment-specific implementations (NodeJS, Browser, React-Native).
33 lines • 1.75 kB
TypeScript
import type { Key, Keyset } from '@atproto/jwk';
import type { OAuthAuthorizationServerMetadata } from '@atproto/oauth-types';
import type { Fetch } from '@atproto-labs/fetch';
import type { GetCachedOptions } from './oauth-authorization-server-metadata-resolver.js';
import type { ClientAuthMethod } from './oauth-client-auth.js';
import type { OAuthResolver } from './oauth-resolver.js';
import { type DpopNonceCache, OAuthServerAgent } from './oauth-server-agent.js';
import type { Runtime } from './runtime.js';
import type { ClientMetadata } from './types.js';
export declare class OAuthServerFactory {
readonly clientMetadata: ClientMetadata;
readonly runtime: Runtime;
readonly resolver: OAuthResolver;
readonly fetch: Fetch;
readonly keyset: Keyset | undefined;
readonly dpopNonceCache: DpopNonceCache;
constructor(clientMetadata: ClientMetadata, runtime: Runtime, resolver: OAuthResolver, fetch: Fetch, keyset: Keyset | undefined, dpopNonceCache: DpopNonceCache);
/**
* @param authMethod `undefined` means that we are restoring a session that
* was created before we started storing the `authMethod` in the session. In
* that case, we will use the first key from the keyset.
*
* Support for this might be removed in the future.
*
* @throws see {@link OAuthServerFactory.fromMetadata}
*/
fromIssuer(issuer: string, authMethod: ClientAuthMethod, dpopKey: Key, options?: GetCachedOptions): Promise<OAuthServerAgent>;
/**
* @throws see {@link OAuthServerAgent}
*/
fromMetadata(serverMetadata: OAuthAuthorizationServerMetadata, authMethod: ClientAuthMethod, dpopKey: Key): Promise<OAuthServerAgent>;
}
//# sourceMappingURL=oauth-server-factory.d.ts.map