2017-10-18 30 views

答えて

0

はい、可能です。

ConfigureServicesで認証方式を正しく設定する必要があります。

services.AddAuthentication() 
     .AddCookie("MyCookieAuthenticationScheme", options => { 

     }) 
     .AddAnotherHandler("AnotherName", options => { }); 

そして、各コントローラ/アクションのために、あなたは資格制度

例を指定する必要があります。

[Authorize(AuthenticationSchemes = "Scheme1")] 
public IActionResult Test1() { } 


[Authorize(AuthenticationSchemes = "Scheme2")] 
public IActionResult Test2() { } 


[Authorize(AuthenticationSchemes = "Scheme1,Scheme2")] 
public IActionResult Test3() { } 

必要な場合にも、独自の認証ハンドラを作成することができます。

幸運、 Seb

関連する問題