Showing posts with label AWS. Show all posts
Showing posts with label AWS. Show all posts

Wednesday, August 16, 2017

AWS Lambda - Custom Authorization

Lambda Code

Refer

public AuthPolicy Authorization(TokenAuthorizerContext request)
{
    var token = request.AuthorizationToken;

    switch (token.ToLower())
    {
        case "allow":
            return generatePolicy("user", "Allow", request.MethodArn);
        case "deny":
            return generatePolicy("user", "Deny", request.MethodArn);
    }

    return null;
}


At Lambda to Custom Authorization


Add Custom Authorization to API Gateway Method


POSTMAN Test



Monday, August 7, 2017

AWS Lamda

  • Service that lets you run code without managing servers (server-less)
  • Execute your code when needed and scales automatically. (no charge when your code not running)
  • Included Server and OS maintenance, auto scaling,  code monitoring and logging (FOC)
  • Support Node.js, Java, C# and Python.
  • It can run your code in response to events. E.g. Data Processing trigger for Amazon S3 or Amazon DyanamoDB
  • It can build Serverless applications. (only concern your code)
  • Outsider call Lambda thru API Gateway
  • Lambda can be custom authorization  at API Gateway
Step to create Lambda Project in VS2017


1) Need to Install AWS Extension



2) Deployment



3) API Gateway