bruno-garcia / Bazinga.AspNetCore.Authentication.Basic

Basic Authentication for Microsoft ASP.NET Core Authentication
MIT License
48 stars 13 forks source link

Multiple authentication schemes #14

Closed ChrisBellBO closed 3 days ago

ChrisBellBO commented 3 days ago

Hi

This looks like just what I need. If I just enable basic authentication it does what I want but if I then try something like

services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme)
  .AddCookie(o => o.LoginPath = new PathString("/login"))
  .AddBasicAuthentication(...

then it always uses cookie authentication, if I switch the default scheme to basic then it always tries to use basic authentication. I'd like to use cookie authentication by default, but switch to basic if the basic auth header comes through with the http request. Am I missing something?

ChrisBellBO commented 3 days ago

I'm thinking this is a general problem and not specifically related to this code so I'm closing until I figure it out