-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Open
Labels
api-suggestionEarly API idea and discussion, it is NOT ready for implementationEarly API idea and discussion, it is NOT ready for implementationarea-authIncludes: Authn, Authz, OAuth, OIDC, BearerIncludes: Authn, Authz, OAuth, OIDC, Bearer
Milestone
Description
Background and Motivation
In reference to #59462, there is a new scenario during OIDC PAR login flow where a configuration would result in an error. The optimal solution would be to add a new OIDC event to the API to make it easier to handle this error.
Proposed API
In reference to #61947, add new event to OpenIdConnectEvents
class. Event name would be OnPushAuthorizationFailed
.
Usage Examples
Example originally documented in #61947
builder.Services.AddAuthentication(...)
.AddOpenIdConnect("oidc", options =>
{
...
options.Events.OnPushAuthorizationFailed = (ctx) => {
var logger = ctx.HttpContext.RequestServices.GetRequiredService<ILogger<Program>>();
logger.LogError(ctx.Exception, "Received error while sending PAR request.");
ctx.Response.Redirect("FriendlyErrorPage");
ctx.Handled = true;
return Task.CompletedTask;
};
});
Alternative Designs
No. I attempted to follow the existing API event design.
Risks
No exceptional risks identified.
Metadata
Metadata
Assignees
Labels
api-suggestionEarly API idea and discussion, it is NOT ready for implementationEarly API idea and discussion, it is NOT ready for implementationarea-authIncludes: Authn, Authz, OAuth, OIDC, BearerIncludes: Authn, Authz, OAuth, OIDC, Bearer