DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Join us tomorrow at 1 PM EST: "3-Step Approach to Comprehensive Runtime Application Security"
Save your seat

Using DynamoDB and Web Identity Federation

Let's take a look at using DynamoDB and web identity federation. Also, explore the DynamoDB configurations.

Muhammad Ali user avatar by
Muhammad Ali
·
Oct. 08, 18 · Opinion
Like (1)
Save
Tweet
Share
3.33K Views

Join the DZone community and get the full member experience.

Join For Free

Scenario

Let’s say you are developing a game application or any other web application on AWS public cloud platform that uses DynamoDB for storing all application related data. Now, if your application is expected to have thousands of users, then it will not be viable for you to create IAM user and then provide these users access to the tables in Dynamo DB for storing application related data, like their score in case of a game or shopping cart etc. The solution to this scenario is to use Web Identity Federation, which will leverage user’s existing accounts on Google, Facebook or any other identity provider, to provide temporary access to the Dynamo DB data.

Let’s look into an example of how to make configurations for this.

DynamoDB Configurations

Create a DynamoDB table and call it "Score."

  1. Create Partition key and a Sort key. Complete creation of the table.
  2. Go to "Access control" and select ‘Facebook’ as the identity provider or any other as per your requirement.
  3. Select the "Actions" that you want to allow your users to perform.
  4. Select the "Attributes" that you want your users to have access to.
  5. Select Create policy and copy the code generated in the policy panel. See the snapshot below.

IAM Configurations

  1. Go to IAM console and select “Create Policy." Under the JSON tab, paste the code that you copied in step 6 of above section i.e. DynamoDB Configurations. Move to the next page.

  1. Give the policy a name, for example, ‘DynamoDB-Policy’ and complete the policy creation process.
  2. Now, create a new role.
  3. Select Web Identity as the Trusted Identity of your role.
  4. Select "Facebook" as the Identity Provider and enter the applications ID that you retrieved from your Facebook development account.

  1. Go to "Next: Permissions" screen and search for the policy you just created. Type in your policy name, for example, "DynamoDB-Policy," in this case, and select it and move to the next step.
  2. Provide the role a name and description.

Conclusion

One this setup is in place, you can start developing your application that uses social media identity providers like Facebook in this example to authenticate and authorize your users. You also have the option to use Amazon Cognito that is the best fit for quickly and easily managing your users coming through third party identity providers.

Web application Federation (information technology)

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • NEXT.JS 13: Be Dynamic Without Limits
  • When AI Strengthens Good Old Chatbots: A Brief History of Conversational AI
  • Playwright vs. Cypress: The King Is Dead, Long Live the King?
  • Secrets Management

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: