Skip to main content

Configure identity server from scratch in .net core 3


Step 1: install .net cli template scaffolding support using below command

            
dotnet new --install IdentityServer4.Templates::3.0.3


Post installation you should be able to see below new templates for identity server 
   
    

Step 2 :we will be using is4aspid template for out this tutorial, below is the command to create new project

      dotnet new is4aspid
    
    

   After running above command it will ask for inserting test data ,press ‘Y’
  

Step 3 : Open .csproj file in Visual studio 2019  to verify new project


      

    run below three commands to restore , build, run the new project

  • dotnet restore
  • dotnet build
  • dotnet run  


  Verify the application running in browser 
  


Next click on hyperlink to manage stored grants, you will be redirected to login page


Step 4 :Configure Identity server to use sql server instead of in memory sql lite

   Install entityframework core sql server nuget package 


  Modify sql connection string in appsettings.json
 

Modify existing code in startup.cs configureservice method to use sql server instead of in memory sqllite


Run command dotnet ef database update




Verify the new database in your db server




Congrats you have configured identity server 4 in .net core ,now you can insert user information in AspNeUsers table and start playing around it.s



Comments