Mild.DesignPattern.**
: Design Pattern SeriesMild.EF.**
: Entity FrameworkMild.MVC.**
: ASP.NET Core MVCMicrosoft.Learn.**
: Microsoft docs & learn modulesMicrosoft.**
: Sample Code from Microsoft example
- Microsoft.Learn.SecureAspnetCoreIdentity
- Microsoft.React.Authentication.Starter
- Mild.DesignPattern.MementoPattern
- Mild.EF.RazorPage.Example.ContosoUniversity
- Mild.MVC.Authentication.Minimal
- Mild.MVC.Authentication.Openiddict.OAuth2.AuthorizationCodeRefreshToken
- Mild.MVC.Authentication.Openiddict.OAuth2.ClientCredentials
- Mild.MVC.Authentication.Openiddict.React
- Mild.MVC.Minimal
- Mild.React.Starter
This project will be followed the learn modules: Secure an ASP.NET Core web app with the Identity framework
This project was created from the Code
├───start ## Starter template
└───final ## Final code from this tutorial
Note: The original article was designed in Azure Cloud Shell. Some how I can't use it one the website. So, I modify the article for local development.
The original article provides PosgreSQL & SQL Server, this article will apply docker and PosgreSQL for local development.
- Introduction
- Set up the environment
- Configure Identity support
- Customize Identity
- Configure multi-factor authentication
- Use claims with policy-based authorization
An online dog toy retailer, named Contoso Pets, is creating an app for viewing and managing the product catalog. You're asked to secure the app.
This module explores using ASP.NET Core Identity to support authentication and authorization in an ASP.NET Core Razor Pages web app.
In this module, you will:
- Configure Identity support in an existing ASP.NET Core web app.
- Provide new user registration capabilities.
- Extend Identity UI components.
- Customize multi-factor login capabilities.
- Implement policy-based authorization using claims.
- Customize and extend the underlying Identity data store.
Setup .NET Core 5 with React
Using react
template (dotnet new reactredux -au Individual
)
- useSPA
- Class components
- Openid Connect with Identity Server
Note: this project for educational purpose.
Demonstrate Memento Pattern: It able to undo and redo a state of objects.
Following in Doc: docs.microsoft.com - Razor Pages with Entity Framework Core in ASP.NET Core
All explanation are inside inline comment
- Razor Page
- SQLite
- MVC
- Cookie Authentication (SSR)
- Razor Page controlled by the Controller
- Session Management
- No connect to any DB
-
Enable the the Client Credentials Flow, which is suitable for machine-to-machine applications.
-
Enable the Authorization Code Flow with PKCE which is the recommended flow for Single Page Applications (SPA) and native/mobile applications.
-
Enable the Refresh Token
- MVC
- Cookie Authentication (SSR)
- Razor Page controlled by the Controller
- Session Management
- Use
Openiddict
for OAuth2
- No connect to any DB
Enable the the Client Credentials Flow, which is suitable for machine-to-machine applications.
- MVC
- Cookie Authentication (SSR)
- Razor Page controlled by the Controller
- Session Management
- Use
Openiddict
for OAuth2
- No connect to any DB
Just a basic MVC
Moved to SukreepCode/Mild.ReactTS.Starter
Minimal setup .NET Core 5 with React TypeScript.
Using reactredux
template (dotnet new reactredux
), removed Redux.
Refactor from a class component to functional component.
- useSPA
- TypeScript
- No Redux
- Functional components
node merge-md.js