Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IdentityServer on Azure

I'm trying to make an ASP.NET Core Web application to host IdentityServer and use it as my main authorization service, shared across many other apps.

I followed the quick start tutorial that consists in installing a nuget package (called IdentityServer4) in an empty MVC application template.

Everything is working fine on my machine (debugging with VS2017 & VS2019 preview). I tried to publish the app as an Azure App Service like i did with previous apps and worked fine.

While debugging, if i open a browser and type "https://localhost:44316/", i see this page:

enter image description here

But navigating to "https://xxx.azurewebsites.net" (that is where i published the app) is not working. Responding 404 not found.

Just to add some detail, if i navigate this "https://localhost:44316/Account/Login?ReturnUrl=%2Fgrants", i obtain the correct login page and doing the same on Azure produces the same result.

So, essentially, looks like it's working, except for the home page.

I'm not an expert in routing with ASP.NET Core, so don't blame me if my question is not so smart.

like image 293
mororo Avatar asked Mar 28 '19 15:03

mororo


People also ask

Why should I use IdentityServer?

It's designed to provide a common way to authenticate requests to all of your applications, whether they're web, native, mobile, or API endpoints. IdentityServer can be used to implement Single Sign-On (SSO) for multiple applications and application types.

Is Azure a OIDC?

Azure AD: The OIDC provider, also known as the identity provider, securely manages anything to do with the user's information, their access, and the trust relationships between parties in a flow. It authenticates the identity of the user, grants and revokes access to resources, and issues tokens.

Is IdentityServer4 obsolete?

The current version (IdentityServer4 v4. x) will be the last version we work on as free open source. We will keep supporting IdentityServer4 until the end of life of . NET Core 3.1 in November 2022.


1 Answers

So, essentially, looks like it's working, except for the home page.

This is actually the intended behaviour - If you take a look at the implementation of the HomeController provided in the IdentityServer4.Quickstart.UI project, you'll see the following implementation (source):

public IActionResult Index()
{
    if (_environment.IsDevelopment())
    {
        // only show in development
        return View();
    }

    _logger.LogInformation("Homepage is disabled in production. Returning 404.");
    return NotFound();
}

When running in Azure, the application's environment isn't set to Development environment and so returns 404 NotFound, as shown above.

like image 198
Kirk Larkin Avatar answered Oct 18 '22 02:10

Kirk Larkin