Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I override the default error path in Identity Server 4?

I have an Identity Server 4 implementation where I'm migrating the UI from ASP.NET MVC to a decoupled React app. The problem I have is that when Identity Server handles an error (such as an invalid client) it redirects to /home/error?errorId=<error-id> using, I assume, the path defined in a constant here. I would like to customise this error path so it matches a route in my React app. Any idea how to do this? The nearest I've found to an answer is here on Github where the OP asks if there are plans to make these constants customisable, and Brock Allen replies "Yep"! That was 2016 😁

like image 855
Tom Troughton Avatar asked Oct 30 '19 11:10

Tom Troughton


People also ask

Is Identity Server 4 free?

About IdentityServer4 IdentityServer is a free, open source OpenID Connect and OAuth 2.0 framework for ASP.NET Core.

What will happen to Identity Server 4?

IdentityServer will be rebranded as Duende IdentityServer. IdentityServer4 support will last until the end of life of . NET Core 3.1 that means till November 2022. In that way, Duende provides new documentation for the fifth service version.

What is the latest version of Identity Server?

IdentityServer4 is an OpenID Connect and OAuth 2.0 framework for ASP.NET Core. As of Oct, 1st 2020, we started a new company. All new development will happen in our new organization.

What is Microsoft Identity Server 4?

IdentityServer is an authentication server that implements OpenID Connect (OIDC) and OAuth 2.0 standards for ASP.NET Core. 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.


1 Answers

There's an overload of AddIdentityServer that you can use to configure the IdentityServerOptions that gets used by IdentityServer. Here's an example that sets the ErrorUrl property:

services.AddIdentityServer(options =>
{
    options.UserInteraction.ErrorUrl = "/path/to/error";
})
like image 125
Kirk Larkin Avatar answered Oct 10 '22 03:10

Kirk Larkin