import { Config } from '../core/sdk-config'; import { AuthenticationTokens } from './user-client-interface'; import { DefaultKeyManager } from '../core/key-manager'; import { Logger } from '@sudoplatform/sudo-common'; export interface IdentityProvider { /** * Signs out the user from all devices. * * @param accessToken access token used to authorize the request. */ globalSignOut(accessToken: string): Promise; /** * Registers a new user against the identity provider. * * @param uid user ID. * @param validationData registration parameters. * @return user ID */ register(uid: string, validationData: { Name: string; Value: string; }[]): Promise; /** * Sign into the identity provider using a signing key. * * @param uid user ID. * @param keyId signing key id. * @return Successful authentication result AuthenticationTokens */ signInWithKey(uid: string, keyId: string): Promise; /** * Sign into the identity provider using a token issued by an external * authentication provider. * * @param uid user ID. * @param token authentication token. * @param type token type. * @return Successful authentication result AuthenticationTokens */ signInWithToken(uid: string, token: string, type: string): Promise; /** * Refresh the access and ID tokens using the refresh token. * * @param refreshToken refresh token used to refresh the access and ID tokens. * @return Successful authentication result AuthenticationTokens containing refreshed tokens */ refreshTokens(refreshToken: string): Promise; /** * Signs out the user from this device. * * @param refreshToken refresh token to revoke to sign out this device. */ signOut(refreshToken: string): Promise; } export declare class CognitoUserPoolIdentityProvider implements IdentityProvider { private keyManager; private config; private idpService; private refreshTokenLifetime; private logger; constructor(keyManager: DefaultKeyManager, config: Config, logger: Logger); private initCognitoIdpService; globalSignOut(accessToken: string): Promise; register(uid: string, validationData: { Name: string; Value: string; }[]): Promise; signInWithKey(userId: string, keyId: string): Promise; signInWithToken(userId: string, token: string, type: string): Promise; refreshTokens(refreshToken: string): Promise; signOut(refreshToken: string): Promise; private storeRefreshTokenLifetime; }