#newbie problem: I’m thinking on how to build user...
# prisma-whats-new
d
#newbie problem: I’m thinking on how to build users authentication in graph.cool. My understanding is that in terms of authentication: my app user === graph.cool user (that’s a bit opposite to the ‘default’ practice in RDBM where app has ‘db user’). Is that correct? aaand if that above is correct then how to build (tutorial?) a system like e.g. blog engine/cms/e-shop where app has its own users with all login-remind-my-password etc features - any advice will be priceless!!
a
Yes, that's correct. A JWT token is generated for the app user, and that is used to authenticate against the Graphcool API endpoints.
d
thnx!! so do I have any tools to manage those users in graphcool console of somekind (?)
a
There is a built-in type User, that you can also see in the Graphcool console. If you use any of the built-in integrations, that's where your users 'live'
d
OK. I got it!. Do you have any advice on my second part q?
a
The built-in authentication doesn't offer the features you are looking for (reset password etc.). For that, you need to roll your own authentication mechanism using Schema Extensions. That's still a beta feature though, if you want to use it you need to contact @nilan. After that, you can find numerous authentication examples here: https://github.com/graphcool-examples/functions/tree/master/authentication
The easiest to start with though, is probably the built-in email/password authentication, you can enable that on the 'Integrations' tab in the Console.
d
Thanks a lot man! I owe you! 👍
😎 1
I’ll start with that!
a
There's a basic tutorial here (react/apollo + email/pwd auth): https://www.graph.cool/docs/tutorials/react-apollo-email-oopheesaj9/
d
I’ve found that last one, but my problem was reduced to one paragraph - ‘In console open integration tab and click email enabled’ that made me puzzled a bit. Now I guess I have answers (or at least the direction)
a
d
btw: do you have any experience with auth0 (in production?)
a
Yes, works great too, I use a custom implementation though, based on the Schema Extensions example I linked
d
mhm, I would of course love to escape all that fuss with email verifcation/twitter/google auth/reminders etc 🙂
a
Then you should use that
d
that == auth0 ? 🙂
a
Yes
d
I’m watching now the intro video
(btw looks awesome)
For the record: here is pretty complete tutorial addressing my problem: https://www.graph.cool/docs/tutorials/react-apollo-auth0-pheiph4ooj/ (tnx @agartha for inspiration)