Adding an external Microsoft login to IdentityServer4

Microsoft Authenticator Identity

This article shows how to implement a Microsoft Account as an external provider in an IdentityServer4 project using ASP.NET Core Identity with a SQLite database. Setting up the App Platform for the Microsoft Account To setup the app, login using your Microsoft account and open the My Applications link https://apps.dev.microsoft.com/?mkt=en-gb#/appList Click the Add an app button. Give the application a name and add your email. This app is called microsoft_id4_enrico. After you clicked the create button, you need to generate a new password. Save this somewhere for the application configuration.…

Connect ASP.NET MVC 4.6.2 project to IdentityServer4

I have a website running on ASP.NET MVC 4.5.2. I have an IdentityServer4 server running but when I try and authenticate against it I get an: invalid_request I googled a bit but I can’t find a solution. Finally, I found the way. First, in your IdentityServer4 you have to create a new client: public static IEnumerable GetClients() { return new List<client> { new Client { ClientId = “yourid”, AllowedScopes = new List<string> { “openid” }, AllowedGrantTypes = GrantTypes.Hybrid, RedirectUris = new List { “https://yoururl/signin-oidc” }, } } } When you…

Every application needs identity & access control

Nearly every application deals with data and resources that need to be protected. Implementing secure authentication and authorization is therefore an essential requirement in most cases. While historically the solution to that problem has been either Windows authentication or username/password, this might not hold true anymore. In the distributed and mobile application landscape, passwords have become an anti-pattern, and single sign-on, security token services and federation are the prevalent technologies to achieve a seamless security experience for your users. We have worked in this space for several years, and our…

Call API Management from Blazor

azure api management service wallpaper

The title ”Call API Management from Blazor” is not explain fully what I’m going to explain in this post but it is only a title. So, consider the following scenario. Scenario On Azure API Management Service you have your APIs. For more protection, you want to add another level of security asking to the API Management to validate the user token for each request. The token is validated again your own Identity Server. Once the API Management is configured to use Identity Server for the validation, you want to call…

Blazor using HttpClient with authentication

Microsoft Blazor wallpaper

Today, we are going to learn how to create a secure connection in Blazor using HttpClient with authentication to gain access to the protected resources on the Web API’s side. Everything is based on IdentityServer. Until now, we secure Blazor WebAssembly With IdentityServer4 and enabled login and logout actions. After successful login, IdentityServer sends us the id_token and the access_token. But we are not using that access_token yet. So, in this article, we are going to change that. But, using the access token with Blazor WebAssembly is not going to be our…