Giter Club home page Giter Club logo

rallets / react-ts-azure-ad-b2c Goto Github PK

View Code? Open in Web Editor NEW
6.0 6.0 4.0 1.49 MB

A simple SPA demo app to practice the React basic concepts like Azure AD B2C authentication with MSAL, custom hooks, effects, context, form editing with field array, custom & async debounced form validation and many others.

HTML 3.34% TypeScript 64.54% Batchfile 0.30% Shell 0.55% JavaScript 2.42% C# 28.84%
adb2c bootstrap debounce msal react react-hook-form react-router-dom typescript webapi

react-ts-azure-ad-b2c's Introduction

Azure AD B2C + React + Typescript SPA demo app

Goals

A simple SPA demo app to practice the React basic concepts like Azure AD B2C authentication with MSAL, custom hooks, effects, context, form editing with field array, custom & async debounced form validation and many others.

Packages

This demo uses the following packages:

  • Microsoft Authentication Library for js (MSAL)
  • React
  • Typescript + linter
  • React router
  • React Hook Form
  • React Toastify
  • React Fontawesome svg icons
  • Plain Bootstrap
  • Type-safe Fetch requests with GET, POST, PUT, DELETE methods

Run the demo

Configure AD B2C & related config files

In the React SPA folder the files starting with .env are configuration files. The configurations found in .env can be overridden by the environment-specific file (.env.development, .env.test, .env.production) in which the app is started/deployed. By default npm start starts as development.

  • REACT_APP_API_BASE_URL => the WebApi url. Example: https://localhost:5001.
  • REACT_APP_AD_B2C_TENANT => your Azure AD B2C tenant. Example: yourtenant.onmicrosoft.com
  • REACT_APP_AD_B2C_SIGN_IN_POLICY => your Azure AD B2C sign-in policy. Example: B2C_1_react_sign_up_sign_in
  • REACT_APP_AD_B2C_APPLICATION_ID => your Azure AD B2C application ID. Example: xxxxxxxx-your-xADx-GUID-xxxxxxxxxxxx
  • REACT_APP_AD_B2C_REACT_REDIRECT_URI => your Azure AD B2C redirect uri. Example: http://localhost:3000

Run the WebApi

Navigate to the WebApi folder and run the app (in development mode):

dotnet run

Open https://localhost:5001/items to view it in the browser.

Run the React SPA

Navigate to the React SPA folder and run the app (in development mode):

npm install
npm start

The React SPA will start in a browser at the address http://localhost:3000.

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.