GithubHelp home page GithubHelp logo

Comments (3)

justonian avatar justonian commented on August 24, 2024

Hi Rohit-

Assuming that "friends" is a set, you would want to use a DynamoDB table or some other data store to keep track of each user's friends. Cognito User Pools attributes are meant to be specific to a single user, and the custom attributes which you can define can only be a number or a string of up to 20 characters. Given the size constraint and the fact that you may want to have several indexes on a table showing various friends in different manners, this would be better held in a separate table though you can use the Cognito unique IDs for the user pool user ID or identity ID (if using federated identities) to track friends, if desired.

Let us know if this clarifies for you.

Justin

from aws-serverless-auth-reference-app.

rohitvinay avatar rohitvinay commented on August 24, 2024

@justonian I see that there is a profiles table setup, can i use that to store list of all users, or is there any use case for it. Thanks

from aws-serverless-auth-reference-app.

justonian avatar justonian commented on August 24, 2024

You can. To change the table definition you'd need to modify api/lambda/data.js, though and then run gulp delete_tables and gulp create_tables.

The reason why we're not storing some of the profile information, in our case a profile picture, in the user pools attributes directly is because we want to also evolve the app to showcase login with FB/Google and SAML, in which case the customer's Cognito Federated Identity ID is the best option. However, logging in with Google or SAML wouldn't allow access to the user pool ID's attributes hence we're storing those centrally in a DynamoDB table.

Hope this helps.

Justin

from aws-serverless-auth-reference-app.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.