@aws-amplify/auth
Version:
Auth category of aws-amplify
28 lines (27 loc) • 908 B
TypeScript
import { OAuthOpts, CognitoHostedUIIdentityProvider } from '../types/Auth';
export default class OAuth {
private _urlOpener;
private _config;
private _cognitoClientId;
private _scopes;
constructor({ config, cognitoClientId, scopes }: {
scopes: string[];
config: OAuthOpts;
cognitoClientId: string;
});
oauthSignIn(responseType: string, domain: string, redirectSignIn: string, clientId: string, provider?: CognitoHostedUIIdentityProvider | string): void;
private _handleCodeFlow;
private _handleImplicitFlow;
handleAuthResponse(currentUrl?: string): Promise<{
accessToken: any;
refreshToken: any;
idToken: any;
}>;
private _validateState;
signOut(): Promise<void>;
private _generateState;
private _generateChallenge;
private _base64URL;
private _generateRandom;
private _bufferToString;
}