Error
The error page is used to display to the end user that an error has occurred during a request to the authorize endpoint.
When an error occurs, IdentityServer will redirect the user to a configurable ErrorUrl
.
builder.Services.AddIdentityServer(opt => { opt.UserInteraction.ErrorUrl = "/path/to/error";})
The default ErrorUrl
is “/home/error”. The quickstart UI includes a basic
implementation of an error page at that route.
Errors are commonly due to misconfiguration, and there’s not much an end user can do about that. But this allows the user to understand that something went wrong and that they are not in the middle of a successful workflow.
Error Context
Section titled “Error Context”Details of the error are provided to the error page via a query string parameter. That parameter’s name is configurable
using the ErrorId
option.
builder.Services.AddIdentityServer(opt => { opt.UserInteraction.ErrorId = "ErrorQueryStringParamName";})
By default, the ErrorId
is the string “errorId”.
The interaction service
provides a GetErrorContextAsync
API that will load error details for an ErrorId
.
The returned ErrorMessage object contains these
details.