You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 13, 2018. It is now read-only.
The problem I am reporting seems to be similar to #1381.
Summary
My TL;DR summary is that in ASP.NET Core 2,0 it seems impossible to have multiple authentication schemes handling requests with corresponding values of the Authorization header, while we had no trouble implementing this in 1.1 and earlier with OWIN.
Details
Using ASP.NET Core 2.0, we are adding two custom authentication schemes, let's call them "Abc" and "Xyz", using services.AddSchema() method. When I send a request with Authorization header having either Abc SomeAuthInfo or Xyz SomeOtherAuthInfo value, I expect a corresponding handler to be called by the framework, as it happened in OWIN and later in Core 1.1. That does not happen. The only non-invasive way to make it work was specifying default schema via services.AddAuthentication("Abc"), which resulted in "Abc" scheme working and "Xyz" not working.
with those two hand-rolled classes hacking the default ASP.NET Core 2.0 logic letting us look at what Authorization header value starts with - the scheme - and map it the appropriate handler.
The Question
My question is, is this a bug, or have I simply failed to find a legitimate way to map auth schemes to their handlers?
leopignataro, AKlaus, reddogaw, gusarov, muadhib and 3 more