@studyportals/sp-hs-misc
Version:
Miscellaneous code used in HouseStark's projects
27 lines (26 loc) • 1.37 kB
TypeScript
import { IAuthenticationServicesProvider, IFailedAuthenticationResult, ISuccessfulAuthenticationResult } from "../..";
/**
* @deprecated Use @studyportals/client-internal-platform-sso
*/
declare class CognitoAuthenticationServicesProvider implements IAuthenticationServicesProvider {
private static readonly USER_NOT_FOUND_ERROR_CODE;
private static readonly INCORRECT_SECRET_ERROR_CODE;
private _cognitoUserPoolId;
private _appClientId;
protected get cognitoUserPoolId(): string;
protected get appClientId(): string;
constructor(cognitoUserPoolId?: string, appClientId?: string);
authenticate(userIdentifier: string, secret: string): Promise<ISuccessfulAuthenticationResult | IFailedAuthenticationResult>;
registerUser(userIdentifier: string, secret: string): Promise<void>;
changePassword(userIdentifier: string, oldSecret: string, newSecret: string): Promise<void>;
private createUser;
private createUserFromUserPool;
private createAuthenticationDetails;
private createSuccessfulAuthenticationResultFromCognitoUseSession;
private authenticationFailedBecauseUserDoesNotExist;
private authenticationFailedBecauseTheSecretIsIncorrect;
private createResultForUserDoesNotExist;
private createResultForIncorrectSecret;
private createUserPool;
}
export { CognitoAuthenticationServicesProvider };