Skip to content

Authing/authing-multiple-tenant-demo

Repository files navigation

Authing Multi-Tenant Demo

License

English | 简体中文

Introduction

This Demo will show you how to use Authing's Multi-tenant management through a multi -tenant journey.

1. Preparation

Login to the Authing Console, select the ToB userpool, and enter the Back-Console.

1.1 Prepare an application as Demo application

image-20230113110756473

1.2 Prepare a user as a Demo user

image-20230113111210248

2. Modify configuration

2.1 Modify the front-end configuration

Modify the /client/CONFIG_ME_FIRST.ts file, modify the following configuration:

// Here is used to configure external source related variable configuration information
export default {
  /** APP ID */
  appId: "<your app id>",
};

For more front-end configuration see /client/.env environment variables. Generally, special configurations are not required. If special configuration is required, you can create a new copy and store them in the local area.

2.2 Modify the back-end configuration

Copy the /server/.env-example file and renamed/server/.env.

The configuration parameter description is as follows:

Name Illustrate Whether to configure
DEMO_SERVER_PORT Listening port false
DEMO_LOGIN_CALLBACK_HOST Log in to complete the callback domain name false
DEMO_FRONTEND_CALLBACK_URL After the fron-end login is successful, call back the URL false
DEMO_AUTHING_USERPOOL_ID Userpool ID true
DEMO_AUTHING_APP_ID APP ID true
DEMO_AUTHING_APP_SECRET APP Secret true
DEMO_AUTHING_API_ENDPOINT Authing API server address true

image-20230113152420369

Note: Application here to log in to adjust URL needs to fill in the address of the back -end of the project's business http:localhost:3010/auth/callback

3. Launch project

3.1 Started one-click (Recommended)

// npm (The Install will be automatically executed by default, no additional Install is required)
npm run start

// yarn
// yarn start

// pnpm
// pnpm start

3.2 Sub-item start

  • Front-end

    // Open a terminal
    
    cd client
    pnpm install
    pnpm start
  • Back-end

    // Open another terminal
    
    cd server
    pnpm install
    pnpm start

3.3 Visit project

Visit http://localhost:3009

License

MIT

Copyright (c) 2023-present, Authing

About

Authing Multi-Tenant Demo V2

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published