How to - AWS Rest API Authentication

风格不统一 提交于 2019-12-07 20:01:43

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!