0

I wonder how ASP.NET core behaves when there are multiple JWT schemes in project. Does it challenges all the schemes ? If yes how can I get the scheme name (in my controller function) in where the challenge was successful ?

1 Answers1

0

I think you could read the offcial document related:

https://learn.microsoft.com/en-us/aspnet/core/security/authorization/limitingidentitybyscheme?view=aspnetcore-6.0#selecting-the-scheme-with-the-authorize-attribute

and try as the document:

[Authorize(AuthenticationSchemes = AuthSchemes)]
public class MixedController : Controller
{
    ......
    private const string AuthSchemes = "SomeName,AnotherName" 
        
   .....

}
Ruikai Feng
  • 6,823
  • 1
  • 2
  • 11