A guide to use Identity Server 4 in your .NET Core Application (Part 1)

Hey techies. You might wonder what Identity server is. Before going into the guide, let me tell you what this guide really about. Recently I had to work with Identity Server 4. So based on my experience, I thought of writing an article on ‘How to connect an external identity provider with Identity Server 4. This is the first part of the guide. So this will be an introduction to identity server 4. In the next articles, I’ll explain how to integrate an external identity provider with Identity server 4. So let’s get to the topic.

What is Identity Server 4?

When it comes to software engineering (Mostly web development), Authentication takes an important part in all features.  Identity Server 4 is a framework, which is made for ASP.NET Core, to make the authentication logic and the process easier. Identity server acts like middleware between the .NET Core web application and the external identity provider.

Capture
The workflow of the identity server

 

Now you might think “Why to use Identity Server when we can directly connect the external identity provider? “. True. If we use only one external identity provider, it will be fine without Identity Server. But in nowaday systems, there are multiple external identity providers are in use. As an example, most of the web sites now have the option to log in with Facebook, log in with google, login with Microsoft O365…etc. If we wish to use more than one login option in our .NET Core web application, We should use the Identity Server. Let’s discuss the reasons below.

Authentication as a Service

As I said before, the Identity Server acts as middleware. Usually, in a middleware, there is/are centralized logic(s) for different processes. Same here. Identity Server centralized the logic for authentication. All we have to do is connect clients to the middleware and customize them according to our needs.

Single Sign-in / Sign-out

There is an implemented sign in/ sign out function available in Identity Server. Once we connect our clients to Identity Server and when we configured it, Identity Server will perform automatically sign-in to the defined external identity provider as well as sign-out. Identity Server is using the same logic for all kinds of clients.

Customization

This is the most important reason. Identity Server can be easily customized according to the user’s needs. Since this is a framework, we can achieve this very easy.

I hope you get a small idea about Identity server 4. In the next article, I’m gonna show you how you can connect Azure Active Directory with Identity server 4. So, see you in the next article.

 

Reference –  http://docs.identityserver.io/

Leave a comment