Coder Social home page Coder Social logo

fusionauth-example-node-multi-tenant's Introduction

FusionAuth Node.js example

This project is two simple example Node.js applications that illustrates how you can easily implement multi tenant applications using FusionAuth.

To run

This assumes you already have a running FusionAuth instance, user and application running locally. If you don't, please see the 5-Minute Setup Guide to do so.

  • Create two local aliases in your DNS: hooli.local and piedpiper.local, both resolving to 127.0.0.1.
  • Log into the FusionAuth admin panel
  • Create two tenants, Hooli Tenant and Pied Piper Tenant
  • Create two applications, Hooli and Pied Piper
    • Update the Hooli FusionAuth application to allow a redirect of http://hooli.local:3001/oauth-redirect
    • Update the Pied Piper FusionAuth application to allow a redirect of http://piedpiper.local:3000/oauth-redirect
  • Create a user in each tenant. They can have different passwords.
  • Make sure your user has a first name.
  • Register your user for the applications in the corresponding tenant.
  • Return to your terminal window.
  • In the hooli directory, run:
    • npm install
    • update routes/index.js with the client id and client secret of your FusionAuth application.
    • PORT=3001 npm start
  • In the piedpiper directory, run:
    • npm install
    • update routes/index.js with the client id and client secret of your FusionAuth application.
    • PORT=3000 npm start

Open an incognito browser (or a different one)

Go to http://hooli.local:3001/ and login with the previously created user for the Hooli application.

You should see 'Hello [firstname]'.

Then go to http://piedpiper.local:3000. You will be prompted to sign in again with the different password.

fusionauth-example-node-multi-tenant's People

Contributors

mooreds avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

saasory notpritam

fusionauth-example-node-multi-tenant's Issues

Hacktoberfest: Update Dependencies

Verify that the application(s) will work when updating package.json to the latest versions.

Find outdated packages

npm outdated

Update to latest

npx npm-check-updates -u
npm install

Verify application is still functioning by running through README.md and associated documentation.

Please note it may not always make sense to update everything, please mention what if anything went wrong in the PR.

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.