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.

Support callback path based on IApplicationBuilder.Map paths

See original GitHub issue

Is your feature request related to a problem? Please describe. The current callback path does not work together with path matches defined in IApplicationBuilder.Map. If adding the path match prefix from IApplicationBuilder.Map to the callback path, the callback endpoint becomes nested.

What area is it related to BankIdAuthenticationHandler

Describe the solution you’d like An option to add the path that I use in IApplicationBuilder.Map to the callback path. This can then be used in an override of ShouldHandleRequestAsync to handle the nested path.

Describe alternatives you’ve considered URL rewriting etc.

Additional context I have an open stack overflow question on how to work around the issue but it does not seem possible without changing the BankIdAuthenticationHandler.

I could spend the time implementing this if you think it it necessary and will make for a good addition.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:4
  • Comments:13 (13 by maintainers)

github_iconTop GitHub Comments

PeterOrneholmcommented, Oct 11, 2019

I would love to hear your thoughts before submitting a PR.

Had a look at your commit now, looks great from what I can see! You can make a PR so we can see that all tests are green etc. Also easier to comment if we were to find anything before merging 😃

Btw, GitHub has Draft PR:s nowdays. They are great for early feedback, but can’t be merged until the author (you in this case) says it’s ready to do so 😃

spancommented, Oct 10, 2019

Very nice, I will dig right into it.

I am not sure why you think I need the IHttpContextAccessor though. There is an HttpContext available in the base class RemoteAuthenticationHandler that it receives in the InitializeAsync method.

It does not seems to affect the GrandId package:

private string GetAbsoluteUrl(string returnUrl)
    var absoluteUri = $"{Request.Scheme}://{Request.Host.ToUriComponent()}{Request.PathBase.ToUriComponent()}";
    return absoluteUri + returnUrl;

Is there any documentation that you know of that should be updated together with this change?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using RemoteAuthenticationHandler CallbackPath with ...
Using IApplicationBuilder.Map generates nested paths with UseMvc · CallbackPath implementation · Redirect URI with Google using MVC · How ...
Read more >
ASP.NET Core Middleware
Map branches the request pipeline based on matches of the given request path. If the request path ... Map supports nesting, for example:....
Read more >
Minimal APIs in .NET 6
This call specifies a route (e.g., "/") and a callback to execute once a request that matches the route and verb are matched....
Read more >
Backend For Frontend Authentication Pattern with ...
Understand the Backend For Frontend authentication pattern and how it can be implemented in ASP.NET with Auth0.
Read more >
Handling SPA Fallback Paths in a Generic ASP.NET Core ...
In this post I deal with another application specific scenario: Handling client side routed URL handling when the client side routes fall ...
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 Post

No results found

github_iconTop Related Hashnode Post

No results found