Friday, 23 October 2020

Authenticating AWS Lambda Function to a PHP script

I have a php webapp with the following structure:

app
├── user
└── jobs
    ├─ task1.php
    └─ task2.php

The tasks scripts inside the jobs folder can be executed by the users through the web browser. To secure these scripts a session based authentication is implemented in each script.

To automate the execution of these tasks a AWS Lambda function is implemented which calls these scripts through HTTP using their URLs (i.e. https://www.domaine.com/jobs/task1.php).

The probleme is that this Lambda function also need to be authenticated. The implementation I have in mind is to use some service in AWS that allows you to generate a Token as follows:

  1. Lambda: Generate a token using AWS Service
  2. Lambda: Call the task.php script using the Token
  3. Task.php: Verify the token using the AWS Service
  4. Task.php: Continue executing the requested Task

Is there a better way to authenticate the Lambda calls? If not is there a way to implement the previous mecanism?



from Authenticating AWS Lambda Function to a PHP script

No comments:

Post a Comment