Class AWSCognitoUserPoolApi

Hierarchy

  • AWSCognitoUserPoolApi

Constructors

Properties

_cognito: CognitoIdentityServiceProvider
_runtimeConfig: RuntimeConfig
lambda: Lambda

Methods

  • Add an identity provider.

    Returns

    A promise that resolves to the result of the operation.

    Parameters

    • context: KosmosUserContext<object>
    • provider: string

      The identity provider name.

    • metadataUrl: string

      The metadata URL.

    • metadataFile: string

      The metadata file.

    • attributeMapping: string

      The attribute mapping data as string.

    • idpSignout: boolean

      Whether to sign out of the IdP.

    Returns Promise<CognitoOperationResult>

  • Generates a strong password with a length of at least 10 characters.

    Returns

    The generated strong password.

    Returns string

  • Extracts the Cognito User Pool ID from the iss property of a user context.

    Returns

    The extracted Cognito User Pool ID or null if not found.

    Parameters

    Returns null | string

  • This function invokes the Cognito Proxy Lambda with the specified action and parameters.

    Returns

    Returns a promise that resolves to the result of the operation.

    Parameters

    • action: string

      The action to be performed by the Cognito Proxy Lambda.

    • params: any

      The parameters to be passed to the Cognito Proxy Lambda.

    Returns Promise<CognitoOperationResult>

  • Sends a welcome email to a user with the specified parameters.

    Returns

    A promise that resolves to the operation result.

    Parameters

    • temporaryPassword: string

      The temporary password for the user.

    • setPasswordAutomatically: Required<boolean>

      Indicates whether to automatically generate a strong password.

    • context: KosmosUserContext<object>

      The user context object.

    • username: string

      Username of the use to send welcome email too.

    • email: string

      The email of the use to send welcome email too.

    Returns Promise<CognitoOperationResult>

  • Enable or disable MFA with SMS for a user.

    Returns

    A promise that resolves to the result of the operation.

    Parameters

    • context: KosmosUserContext<object>

      The user context.

    • enable: boolean

      A boolean indicating whether to enable or disable MFA with SMS.

    • username: string

      The username for enabling MFA.

    • Optional phoneNumber: string

      The phoneNumber for enabling MFA.

    Returns Promise<CognitoOperationResult>

  • Validates the strength of a password based on certain criteria.

    Returns

    True if the password meets the specified criteria, otherwise false.

    Parameters

    • password: string

      The password to be validated.

    Returns boolean

  • Formats user attributes for use with Cognito.

    Returns

    An array of formatted user attributes with 'Name' and 'Value'.

    Parameters

    • data: Record<string, any>

      The input object containing user attributes.

    Returns {
        Name: string;
        Value: string;
    }[]

Generated using TypeDoc