Welcome to the Auth Lambda function for the FastFood App!
Built with Node.js, AWS Lambda, AWS API Gateway, AWS Cognito — this function integrates with the FastFood ordering system providing authenticated access as needed.
This Lambda function is responsible for:
- Validating user's credentials through WS Cognito
- Returns the JWT token to be used in the request headers through AWS API Gateway
fastfood-auth-lambda/
├── src/
│ ├── exceptions/
│ │ └── invalid-parameter.exception.js
│ │ └── missing-credentials.exception.js
│ │ └── not-authorized.exception.js
│ ├── functions/
│ │ └── authenticate.js
│ ├── helpers/
│ │ └── error-handler.helper.js
│ └── services/
│ └── authentication.service.js
├── .env.example
├── package.json
└── README.md
git clone https://github.com/tech-snack-fiap-soat-tech-challenge/fastfood-auth-lambda.git
npm install
COGNITO_REGION
: AWS region where the Cognito user pool is locatedCOGNITO_CLIENT_ID
: The client ID for the Cognito user pool
The Lambda function accepts HTTP POST requests with a JSON body containing:
{
"userName": "[email protected]",
"password": "userPassword"
}
Successful authentication will return a 200 response with a JWT token:
{
"accessToken": "eyJraWQiOiJ..."
}
Made with ❤️ by TechSnack — The FastFood App