Skip to main content

Window authentication with Identity Server 4 - Part 1 (hybrid client)

Before reading this post, you must be aware of basics of identity server and oauth terms. We will not delve into the basics of identity server here.

Setting up identity server 4

Setup a .Net Core 3.x project and add the nuget package reference for Identity server 4.
Important point here is to have a project with a flexibility to add new views/pages.
Once we add the nuget reference of Identity server 4, we will add a few lines of code in ConfigureServices method of our Startup.cs file
Here is a look at our Config.cs class
This way we have added a client with a custom grant type "iwa" representing integrated window authentication. This will be used in part 2 when we will protect our API resources for a SPA.

Window authentication with hybrid flow i.e. MVC client

Next we will create a MVC project (you can create any web project). We need to ensure that the client parameters used in this project should be same as registered in Identity Server setup.
Here is the view of our startup.cs file
Now we need to add a view our identity server project where this MVC application will redirect and authenticate itself and returns back. This redirection will be very spontaneous.
Let's add an account controller in our identity server project and add below methods
Now we are ready to rock, once you run the identity server and mvc application then you will see that mvc application will redirect automatically to identity server, identity server will authenticate the window user and we are then again redirected back to mvc application url. This whole process is automated and quick to execute.

Comments

  1. Best Mobile Casino Apps for Android and iOS - JtmHub
    Top mobile casinos online are the ones to 속초 출장샵 check out. They will be available in 김천 출장안마 more than half of the apps 동해 출장샵 available for 서울특별 출장안마 iOS and Android smartphones. 대전광역 출장샵

    ReplyDelete
  2. Casino Near Me - MapyRO
    Casino 경상북도 출장안마 Near Me - Best Casino in Oregon, United States - Find Official Portal. Casino near me in 부산광역 출장안마 Reno, 동해 출장샵 NV, USA, Mapyro offers 창원 출장안마 you a 고양 출장샵 safe, convenient, and secure

    ReplyDelete

Post a Comment

Popular posts from this blog

C# Source Generators - a key to metaprogramming !!

C# Source generators - finally you are real !! Guys, if you are interested in compile time metaprogramming then this blog is a good place to land. Source code generator is a much awaited feature and now a reality in .Net 5 preview version. If you are not aware of what is source generator then don't worry, I expect most of the developers at the time when this blog is published are not aware of this feature. Take a deep breadth and relax!! Source code generators are the new feature of C# compiler or you can say the compiler capability that can inspect a program at the compile time and generate new source files that can be added to source code while compiling the code. This functionality is a piece of code in .Net Standard 2.0 assembly. So C# developers now you can inspect the user code and generate C# ...