Skip to content

Serverless Stack Update to IAM #108

@jayair

Description

@jayair

Update July 19

The guide and the sample projects have been updated. A few links for reference:


What is going on

We are updating the Serverless backend API to use IAM as an authorizer and React.js app to make signed API requests.

What is going to happen

Over the next few days we'll post the chageset for the proposed update to give people a chance to review it. And then we'll update Serverless-Stack.com and all the code for the demo project. We'll still leave the changeset up and tag the repo in case people still want to look at the older version of the tutorial.

What should I do

If you are currently working through the tutorial there will be a changeset to refer to. And use this comment thread for help if you have any questions.

Why the change

The current version of the tutorial uses the User Pool directly as an authorizer for the backend. While this works, the recommended way to do authorization in AWS is by using the IAM. All AWS API requests must be securely signed with Signature Version 4 using IAM credentials. Serverless Framework added support for IAM as an authorizer relatively recently. To use IAM as an authorizer we need to use our Cognito Identity Pool to grant our users temporary IAM credentials. This setup is also necessary in the case where you would like to add Google or Facebook as a way to authenticate your users.

Is this a big change

It is not a very big change to the code base of our demo project. But the flow is a little different and the two setups (the current one and the IAM one) cannot work together at the same time. Also, IAM as an authorizer is more secure but it can be a lot more confusing to set up and difficult to work through.


As always feel free to contact us via Twitter (@fanjiewang or @jayair) or email if you have any questions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions