Using AssumeRoleWithWebIdentity API you can authenticate users using web identity providers such as Amazon, Google, Facebook or any other open-id compatible identity provider.
Following steps need to be completed first:
-
Go to IAM
-
Click on Create New Role
-
Select Role for identity provider access
-
Select grant access to identity providers
-
Select the identity provider (e.g. Facebook)
-
After verifying policies, attach policies.
-
Note: If you are doing this for dynamodb, you can generate a policy document for web identity providers from dynamodb dashboard and use that to create a policy in IAM and then attach it.
-
Following steps are followed for Authentication:
-
User authenticates with the web identity provider
-
ID provider passes back a token.
-
Need to call AssumeRoleWithWebIdentity from code specifying the token received and the ARN for the IAM role.
-
You get back temporary credentials from Amazon STS (Security Token Service)
-
You code can access the amazon service (e.g. dynamodb). Default expiry is 1 hour.
- heartin's blog
- Log in or register to post comments
Recent comments