Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the ability to override the SuppressWWWAuthenticateHeader based on path. #146

Open
joursler-Sunset opened this issue Dec 18, 2024 · 2 comments

Comments

@joursler-Sunset
Copy link

Is your feature request related to a problem?
Generally I want SuppressWWWAuthenticateHeader set to true, however for a Library UI (Hangfire) I want to use Basic Auth and need to trigger the www-authenticate header for basic auth on a specific path.

Describe the feature you would like
add a configuration option and associated code to BasicAuthenticationOptions for SuppressWWWAuthenticateHeaderPathOverride and BasicAuthenticationHandler.

Additional context

joursler-Sunset added a commit to joursler-Sunset/idunno.Authentication that referenced this issue Dec 18, 2024
…ng the SuppressWWWAuthenticateHeader configuration setting based on the root of the path.
joursler-Sunset added a commit to joursler-Sunset/idunno.Authentication that referenced this issue Dec 18, 2024
@blowdart
Copy link
Owner

You should be able to do this already with sub applications,

app.UseEndpoints(endpoints =>
{
    var subApp = app.New();
    subApp.UseMiddleware<FooMiddleware>();
    endpoints.Map("/foo", subApp.Build());
}

This ought to allow you to setup different configurations - does that not work?

@joursler-Sunset
Copy link
Author

Its not something I have tried. Ill give that a go and see how it works out. (also didn't even know about sub apps).

The library at issue is Hangfire so we will see.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants