Posts

Showing posts with the label sso

Auth0, Hasura, Social Media Login

Image
We all want a super simple login and sign up system, so that our customers can become our members in a second and keep logging in without any hassle. Today we're going to talk about how to do it in the projects when we're using Hasura and Auth0 . Setting Up a Table in Hasura First we need to have a users table in our Hasura, our unique key on email helps our users to login with different providers to the same account. Auth0 Configuration There's not much to add except following any Quickstart , I prefer disabling email&password login and only allowing login via Google and Apple (because for our case it was an iOS project). It gives a really simple experience to our customers. Auth0 Rule for Syncing Users to Hasura This is the most important part, it should be added as a Rule under Auth Pipeline. Whenever a successful login happens at Auth0 end, this code below runs. This code communicates with our Hasura via API and injects the just logged in user to our table that we ...