## API Report File for "@aws-cdk-blocks/auth-common" > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts import type { BlocksContext } from '@aws-cdk-blocks/core'; // @public export interface AuthAction { capability?: 'webauthn-get' | 'webauthn-create'; fields: AuthField[]; label: string; method?: 'GET' | 'POST'; name: string; unavailable?: string; url?: string; } // @public export type AuthActionInput = { [K in keyof AuthActionPayloadMap]: { action: K; } & AuthActionPayloadMap[K]; }[keyof AuthActionPayloadMap]; // @public export interface AuthActionPayloadMap { autoSignIn: { username: string; }; completePasskeyRegistration: { credential: string; }; // (undocumented) confirmResetPassword: { username: string; code: string; newPassword: string; }; // (undocumented) confirmSignIn: { challenge: 'code'; session: string; code: string; } | { challenge: 'mfaType'; session: string; mfaType: string; } | { challenge: 'newPassword'; session: string; newPassword: string; } | { challenge: 'totpSetup'; session: string; sharedSecret: string; code: string; } | { challenge: 'email'; session: string; email: string; } | { challenge: 'password'; session: string; password: string; } | { challenge: 'firstFactor'; session: string; firstFactor: string; } | { challenge: 'webauthn'; session: string; credential: string; }; // (undocumented) confirmSignUp: { username: string; code: string; password?: string; }; deletePasskey: { credentialId: string; }; getMfaPreference: {}; listPasskeys: {}; // (undocumented) resendSignUpCode: { username: string; }; // (undocumented) resetPassword: { username: string; }; setUpTotp: {}; // (undocumented) signIn: { username: string; password: string; }; signInWithPasskey: { username: string; }; // (undocumented) signOut: {}; // (undocumented) signUp: { username: string; password: string; } & Record; startPasskeyRegistration: {}; updateMfaPreference: { sms?: AuthMfaSetting; totp?: AuthMfaSetting; email?: AuthMfaSetting; }; verifyTotpSetup: { code: string; }; } // @public export type AuthErrorName = (typeof AuthErrors)[keyof typeof AuthErrors]; // @public export const AuthErrors: { readonly NotAuthenticated: "NotAuthenticatedException"; readonly NotAuthorized: "NotAuthorizedException"; readonly PasswordResetRequired: "PasswordResetRequiredException"; readonly TokenExpired: "TokenExpiredException"; readonly ReauthenticationRequired: "ReauthenticationRequiredException"; readonly SignOutIncomplete: "SignOutIncompleteException"; readonly UserAlreadyExists: "UsernameExistsException"; readonly UserNotConfirmed: "UserNotConfirmedException"; readonly UserNotFound: "UserNotFoundException"; readonly AliasExists: "AliasExistsException"; readonly UnsupportedUserState: "UnsupportedUserStateException"; readonly InvalidPassword: "InvalidPasswordException"; readonly CodeMismatch: "CodeMismatchException"; readonly ExpiredCode: "ExpiredCodeException"; readonly InvalidParameter: "InvalidParameterException"; readonly MFAMethodNotFound: "MFAMethodNotFoundException"; readonly SoftwareTokenMFANotFound: "SoftwareTokenMFANotFoundException"; readonly EnableSoftwareTokenMFA: "EnableSoftwareTokenMFAException"; readonly WebAuthnNotEnabled: "WebAuthnNotEnabledException"; readonly WebAuthnOriginNotAllowed: "WebAuthnOriginNotAllowedException"; readonly WebAuthnRelyingPartyMismatch: "WebAuthnRelyingPartyMismatchException"; readonly WebAuthnChallengeNotFound: "WebAuthnChallengeNotFoundException"; readonly WebAuthnCredentialNotSupported: "WebAuthnCredentialNotSupportedException"; readonly WebAuthnClientMismatch: "WebAuthnClientMismatchException"; readonly WebAuthnConfigurationMissing: "WebAuthnConfigurationMissingException"; readonly ProviderNotConfigured: "ProviderNotConfiguredException"; readonly ProviderUnavailable: "ProviderUnavailableException"; readonly IdpError: "IdpErrorException"; readonly InvalidState: "InvalidStateException"; readonly InvalidCallback: "InvalidCallbackException"; readonly InvalidRelay: "InvalidRelayException"; readonly SdkOutdated: "SdkOutdatedException"; readonly EmailPasswordNotEnabled: "EmailPasswordNotEnabledException"; readonly NoFederatedProvider: "NoFederatedProviderException"; readonly PasskeysNotEnabled: "PasskeysNotEnabledException"; readonly MfaNotEnabled: "MfaNotEnabledException"; readonly LimitExceeded: "LimitExceededException"; readonly TooManyRequests: "TooManyRequestsException"; readonly TooManyFailedAttempts: "TooManyFailedAttemptsException"; readonly GroupNotFound: "ResourceNotFoundException"; readonly InvalidLambdaResponse: "InvalidLambdaResponseException"; readonly UserLambdaValidation: "UserLambdaValidationException"; readonly InternalError: "InternalErrorException"; readonly InsecureTransport: "InsecureTransportException"; }; // @public export interface AuthField { defaultValue?: string; label: string; name: string; required: boolean; type: 'text' | 'password' | 'email' | 'tel' | 'number' | 'hidden'; } // @public export type AuthMfaSetting = 'ENABLED' | 'DISABLED' | 'PREFERRED' | 'NOT_PREFERRED'; // @public export interface AuthState { actions: AuthAction[]; error?: string; errorName?: string; retriable?: boolean; state: 'signedOut' | 'signedIn' | 'confirmingSignUp' | 'confirmingSignIn' | 'confirmingMfa' | 'confirmingPasswordReset'; user?: U; } // @public export interface AuthStateApi { // (undocumented) getAuthState(): Promise>; // (undocumented) setAuthState(input: I): Promise>; } // @public export interface AuthUser { displayName?: string; userId: string; username: string; } // @public export type AuthUserOf = A extends { getAuthState(): Promise>; } ? U : AuthUser; // @public export interface BlocksAuth { checkAuth(context: BlocksContext): Promise; getCurrentUser(context: BlocksContext): Promise; requireAuth(context: BlocksContext): Promise; requireRole(context: BlocksContext, role: string): Promise; } // @public export function isAuthError(e: unknown, name?: N): e is Error & { name: N; }; // @public export function isAuthErrorName(value: unknown): value is AuthErrorName; // (No @packageDocumentation comment for this package) ```