Logging Action Execution Details with AWS Lambda and Auth0 Management API

Overview

This article explains how to log and access the details of Auth0 Action executions using AWS Lambda and the Auth0 Management API. By extracting the action execution IDs from the log details and calling the Management API, retrieve comprehensive information about each action execution, including console logs and execution details.

Applies To

  • Auth0 Management API
  • Auth0 Action executions using AWS Lambda

Cause

Actions logs cannot be consumed directly from the event logs (Monitoring > Logs ).

Solution

  1. Create an AWS Lambda function that calls the Auth0 Management API GET /actions/executions/{id} endpoint for each extracted execution ID that is being emitted on each tenant log generated as part of that authentication flow. This endpoint retrieves detailed information about a specific action execution, including any console logs from the action code.
  2. Within the Lambda function, process the response data from the Management API to access the action execution details, console logs, and any other relevant information that needs to be logged or analyzed.
  3. Customize the Lambda function’s logic based on the action execution data to meet the specific logging or monitoring requirements.