question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Investigate using endpoint routing in the ASP.NET Core host

See original GitHub issue

https://github.com/aspnet/AspNetCore/issues/17615

These 3 modes are currently supported by OpenIddict’s ASP.NET Core 2.x and 3.x host:

  • Pass-through mode (enabled globally - per endpoint - using e.g options.UseAspNetCore() .EnableAuthorizationEndpointPassthrough()): in this case, OpenIddict extracts the OIDC payload, validates it and allows the rest of the ASP.NET Core pipeline to be invoked.

  • Pass-through mode (enabled dynamically using OpenIddict’s context.SkipRequest() API): it works like the previous mode, but pass-through is configured dynamically, per request, by calling context.SkipRequest() from an OpenIddict event handler. This is commonly used to transparently handle authorization requests that can processed immediately (e.g when prompt=none is specified and the user is already logged in) without preventing other requests from reaching the MVC authorization controller (typically, when you need to render a consent form).

  • Non-pass-through mode: in this case, requests are exclusively handled using OpenIddict’s events model. This is the expected operating mode for things like discovery, introspection or revocation requests, but we shouldn’t prevent them from being handled manually later in the pipeline.

We’ll need to determine how ASP.NET Core 5.0’s plans may affect corresponding scenarios.

@Tratcher could endpoint routing be used with these 3 modes? I’m not too concerned by the “routing” aspect - which seems flexible enough - but the “endpoint” part seems way more limiting in our case, as there’s no way for an endpoint to declare it’s not going to “handle” a request.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:16 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
rynowakcommented, Dec 10, 2019

Because AFAICT, the motivation to use that is to avoid creating instances of authentication handlers that are not going to handle the request (i.e because the request path doesn’t match the registered path), which is more a routing concern than anything else.

I’ll catch up with @Tratcher on this discuss then. It sounds like there’s a desire to improve this, but I’m not sure why it requires anything other than looking at the currently selected endpoint.

0reactions
kevinchaletcommented, May 31, 2022

Looks like https://github.com/dotnet/aspnetcore/issues/17615 hasn’t been very active lately so closing for now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Routing in ASP.NET Core
Discover how ASP.NET Core routing is responsible for matching HTTP requests and dispatching to executable endpoints.
Read more >
How to use attribute routing in ASP.NET Core
Use attribute routing at the controller level in ASP.NET Core ... Attribute routing can be used both at the controller and action method...
Read more >
ASP.NET Core Routing Basics
Routing exposes endpoints and maps incoming requests to them using routes. · We can use route defaults, route templates, and route constraints to ......
Read more >
ASP.NET Core Endpoint Routing
The Endpoint Routing is the Process by which ASP.NET Core inspects the incoming HTTP requests and maps them to applications executable Endpoint.
Read more >
Missing endpoints in endpoint based routing .net core 3.1
I'm working with multitenant .net core web application which consists of WebApi and MVC routing. With normal behavior application should go to ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found