Building Authentication Server — UI

satish1v
2 min readNov 4, 2022
Photo by Alvaro Reyes on Unsplash

In the previous blog article, we built an identity server project and worked directly with the API. Even with tools like Postman and Insomnia, it is possible. It is really convenient that we can add a user interface to it.

We can easily add a UI to the identity server by using one of the templates that we have already installed.

cd srcidentityserver -- Go to the project folder in cmd line
dotnet new isui

This should create a new folder in the projects called Pages, which contains all the files required for the UI to display.

UI

In the next step, we need to uncomment a few lines of code in the Hosting Extensions file. starting with uncomment the following line from configureServices method

// uncomment if you want to add a UIbuilder.Services.AddRazorPages();

Then, from the configure pipeline method, uncomment the following code.

app.UseStaticFiles();app.UseRouting();// uncomment if you want to add a UIapp.UseAuthorization();app.MapRazorPages().RequireAuthorization();

Now if you the run the application you should see a default webpage with the relevant UI

Now that we have our centralized identity server, it's time to add users, and we will do that in the next blog post.

--

--