Coder Social home page Coder Social logo

auth0-cognito-custom-db's Introduction

Custom database connection with Cognito & Migration turned on

This repo contains the files and insturctions required to setup Cognito as a custom database connection with Auth0.

Cognito Setup

  • Create a user pool in aws cognito
    • For this user pool create an app client
      • This client should have no client secret
      • Make sure to check Enable username password auth for admin APIs for authentication (ALLOW_ADMIN_USER_PASSWORD_AUTH)
      • Make sure to select Legacy under Prevent User Existence Errors
  • Make a note of the following properties
    • UserPoolId - ID of the user pool
    • ClientID - Client ID of the application created above
    • region - AWS Region
    • accessKeyId - Access Key ID
    • secretAccessKey - Secret Access Key

Auth0 Setup

  • Create a database connection
    • Create a custom database connection and choose the name you want to use for it

    • Turn on the toggle Use my own database under the Custom Database tab

    • Under the database settings tab turn on toggles for

      • Requires Username
      • Import Users to Auth0 - This enables migration at login with Cognito
    • Go back to the Custom Database tab

      • Copy contents of auth0LoginDirect.js under the Login script
      • Copy contents of auth0GetUserDirect.js under the Get User script
    • Make sure you save both the scripts above

    • Remain on the same tab and scroll down to settings

      • Set the Confgiuration variables
        • accessKeyId : your access key for AWS
        • secretAccessKey: your secret key for AWS>
        • region : region of aws
        • UserPoolId : Id of the User Pool
        • ClientId : client id of the app created in cognito
    • At this point you have everything setup for the connection

    • Enable the connection in Auth0 by enabling this connection on an application

    • Test login and get user scripts

auth0-cognito-custom-db's People

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

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.