问题
I'm trying to make a Rest API using AWS API Gateway, Lambda, and DynamoDB.
I'm using java-script as my lambda language, and I have successfully created some resources already. However, i don't understand how to make authenticated requests to my IP.
I want simple HTTP Authentication.
Can someone explain how to make authenticated requests to the API Gateway and Lambda?
回答1:
Here is very Good GitHub Lambda Http Authentication Example Repository. You can walk through this example.
A sample authentication service implemented with a server-less architecture, using AWS Lambda to host and execute the code and Amazon DynamoDB as persistent storage. This provides a cost-efficient solution that is scalable and highly available.
回答2:
Another thing to keep in mind is that AWS just announced(Feb 11, 2016) custom request authorizers for API Gateway: https://aws.amazon.com/about-aws/whats-new/2016/02/amazon-api-gateway-supports-custom-request-authorizers
See the AWS example here: http://docs.aws.amazon.com/apigateway/latest/developerguide/use-custom-authorizer.html
"You use this Lambda function to implement various authorization strategies, such as JSON Web Token (JWT) verification and OAuth provider callout, to return IAM policies that authorize the request".
来源:https://stackoverflow.com/questions/35375969/how-to-aws-rest-api-authentication