Asynchronous

Setting up an extension to send out a One-Time Password (OTP) using AWS Lambda/SES.

Extensions used for responding to platform events are run asynchronous. In this section we list the various event payloads as well as show how to configure them.

Configuration

Asynchronous extensions are configured via a rule on the extension itself. You can select from the following categories:

  • Event Types

    • All - triggers upon all event types (implicit - same as leaving blank)

    • API - triggers upon API calls

    • Data - triggers upon input or claims capture (username, OTP & federation)

    • Database - triggers upon resource changes (create, update & delete)

    • Authentication - triggers upon authentication events (pending, success & failed)

    • Authorization - triggers upon authorization events (pending, success & failed)

    • Communication - triggers upon communication requests (send OTP)

  • Event Results

    • All - triggers upon all event results (implicit - same as leaving blank)

    • Success - triggers upon all successful events

    • Failed - triggers upon all failed events

    • Pending - triggers upon all pending events

  • Event Actions

    • All - triggers upon all event actions (implicit - same as leaving blank)

    • ... (see event details below)

  • Event Reasons (only relevant for failed or pending events)

    • All - triggers upon all event reasons (implicit - same as leaving blank)

Combining from multiple categories resembles AND logic, selecting from multiple within a category resembles OR logic. For example you could achieve the following logic which triggers your extension when the event type is either an API call or authentication event, and the result is failed (so failed API request or failed authentication attempts).

Rule configuration for an extension under Extensions in the Quasr Tenant Admin UI.

Events

Authentication API

Factors

Tokens

Controls

Management API (GraphQL)

Factors

Controls

Extensions

Accounts

Tenants

Database

For formatting of detail claim in case of update action see json-diff documentation. Only the changes (differential) are detailed, not the entire resource. In case you need it you'll have to request it via API.

Factors

Controls

Accounts

Extensions

Data

Factors

Authentication

Factors

Authorization

Controls

Communication

Factors

Accounts

Tenants

Example: One-Time Password

An example that pushes the OTP to a public AWS Lambda endpoint to deliver to OTP to the user by email using Amazon Simple Email Service (SES).

The code for the receiving Lambda below.

Configuration of the event rule for an OTP extension

Once a user logs in using the One-Time-Password, the code gets executed, and as in this example, the OTP delivered to the user (in this example, it's simply sent to the Lambda endpoint without further distinction; in real-world scenarios, these could be requests to send an email or SMS via external APIs for example).

OTP delivered via email (Amazon SES)

Last updated