Skip to content

Instantly share code, notes, and snippets.

@KyMidd
Last active July 9, 2025 03:41
Show Gist options
  • Select an option

  • Save KyMidd/0485d1b208230cb11fdf881cdcaa872b to your computer and use it in GitHub Desktop.

Select an option

Save KyMidd/0485d1b208230cb11fdf881cdcaa872b to your computer and use it in GitHub Desktop.
def handle_auth_code_callback(body, event, auth_code, aad_object_id):
# ...
conversation_event = json.loads(response.get("Item")["event"]["S"])
# Add the token to the event
conversation_event["token"] = encrypted_token_base64
# Trigger the Vera Worker lambda to process the event
lambda_client = boto3.client('lambda')
# Asynchronously invoke the processor Lambda
lambda_client.invoke(
FunctionName=os.environ['WORKER_LAMBDA_NAME'],
InvocationType='Event', # Async invocation
Payload=json.dumps(conversation_event)
)
# Debug
if os.environ.get("VERA_DEBUG") == "True":
print("🟢 Successfully invoked the processor Lambda with the access token")
# Delete the saved conversation event from DynamoDB
dynamodb_client.delete_item(
TableName=conversation_table_arn,
Key={
"aadObjectId": {"S": aad_object_id}
}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment