Anup Marwadi
Anup Marwadi

Reputation: 2577

Identity Server 4 with ASP.NET Core 2.2

I've had great success with Identity Server 4 and ASP.NET Core 2.0 by referencing ASP.NET Identity and EF Quick start samples and have been running them in production successfully.

For a new project that I am working on, I was trying to use ASP.NET Core 2.2 and I noticed that all of the ASP.NET Identity related pages are now integrated into a Razor Library which can be scaffolded so that it can be customized.

My Q is: Do we still continue using the old ASP.NET Core 2.0 for integration with ASP.NET Identity and Identity Server? Or are there some examples of porting the quick start code over into the new Razor Pages paradigm of coding?

Thank you!

Upvotes: 3

Views: 5690

Answers (2)

Mohamed Elrashid
Mohamed Elrashid

Reputation: 8619

Don't Use

    app.UseAuthentication();

Instead use Quickstart.UI

    PowerShell -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/IdentityServer/IdentityServer4.Quickstart.UI/master/getmaster.ps1'))"

here a working demo

Step 01

We will open a Run window

On the keybord press

Windoes Key + R

wait

Step 02

We will open a cmd Window

On the Run window text-Input write

cmd

on the Keybord press

Enter

Step 03

Make sure App1/appsettings.json has this connection string , by default it will be there , if not add it

DataSource=app.db

Step 04

We will make a directory and make it the working directory for our cmd

On the CMD Window write

mkdir D:\Projects\P.IT.Support\asp.net

cd /d D:\Projects\P.IT.Support\asp.net

Step 05

We will download and run the script

On the CMD Window write

set scriptUrl="https://gist.githubusercontent.com/Elrashid/133d308902b453c280725379dda02684/raw/Flow4-AspIdentity-Sqlite-RequireConsent-Two-App-For-API-And-Web.bat"

PowerShell -Command "(new-object System.Net.WebClient).DownloadFile('%scriptUrl%','Flow4-AspIdentity-Sqlite-RequireConsent-Two-App-For-API-And-Web.bat')"

Flow4-AspIdentity-Sqlite-RequireConsent-Two-App-For-API-And-Web.bat

Upvotes: 1

Nan Yu
Nan Yu

Reputation: 27588

I'd recommend reading the following if you are upgrading from previous versions:

https://learn.microsoft.com/en-us/dotnet/core/whats-new/dotnet-core-2-2

Then you could evaluate whether some new features you want to achieve via migration for a IDS application .

Or are there some examples of porting the quick start code over into the new Razor Pages paradigm of coding?

You can trace this github issue : Update Quickstarts . Some changes should be modified in Quickstarts document if you are working with .net core 2.2/IdentityServer 2.3 . For example ,the default user is IdentityUser.

If you have any problem when trying to work with that , you can send feedback in that link and trace .

Upvotes: 0

Related Questions