This repository contains example lambdas for integrating Authsignal with Amazon Cognito.
These lambdas are designed to be used together with our React Native example app.
This lambda is called before initiating sign-in with Cognito. It will lookup a user by phone number, email, or Apple/Google ID token, create them in Cognito if they don't exist, and return their username.
The following lambdas are used for signing in to Cognito with SMS OTP, email OTP, passkey, or Apple or Google sign-in:
This lambda is called to authorize enrolling additional authentication methods (e.g. email OTP, SMS OTP, passkey) via a Authsignal Client SDK.
This lambda is called to set the email and phone number attributes as verified in Cognito after enrolling a new email OTP or SMS OTP authenticator.
yarn install
Rename .env.example
to .env
and provide the values for your AWS and Authsignal configuration.
ACCESS_KEY_ID=
SECRET_ACCESS_KEY=
USER_POOL_ID=
USER_POOL_CLIENT_ID=
AUTHSIGNAL_SECRET=
AUTHSIGNAL_URL=
This example uses Serverless Framework to deploy the lambdas.
yarn deploy --region=YOUR_AWS_REGION
For more detailed information on how to integrate Authsignal with Amazon Cognito refer to our official documentation.