|
4 | 4 | using System.Collections.Generic;
|
5 | 5 | using System.IO;
|
6 | 6 | using System.Linq;
|
| 7 | + using System.Security.Claims; |
7 | 8 | using System.Threading.Tasks;
|
8 | 9 | using Common;
|
9 | 10 | using Microsoft.AspNetCore.Authorization;
|
|
17 | 18 | using Microsoft.Extensions.FileProviders;
|
18 | 19 | using Microsoft.Net.Http.Headers;
|
19 | 20 | using Models;
|
| 21 | + using MyTested.AspNetCore.Mvc.Builders.Authentication; |
20 | 22 | using Newtonsoft.Json;
|
21 | 23 | using Services;
|
22 | 24 |
|
@@ -441,6 +443,30 @@ public IActionResult ForbidWithEmptyAuthenticationProperties()
|
441 | 443 | return this.Forbid(TestObjectFactory.GetEmptyAuthenticationProperties());
|
442 | 444 | }
|
443 | 445 |
|
| 446 | + public IActionResult SignInWithAuthenticationPropertiesAndScheme() |
| 447 | + { |
| 448 | + return this.SignIn(ClaimsPrincipalBuilder.DefaultAuthenticated, |
| 449 | + TestObjectFactory.GetAuthenticationProperties(), |
| 450 | + AuthenticationScheme.Basic); |
| 451 | + } |
| 452 | + |
| 453 | + public IActionResult SignInWithEmptyAuthenticationPropertiesAndScheme() |
| 454 | + { |
| 455 | + return this.SignIn(ClaimsPrincipalBuilder.DefaultAuthenticated, |
| 456 | + TestObjectFactory.GetEmptyAuthenticationProperties(), |
| 457 | + AuthenticationScheme.Basic); |
| 458 | + } |
| 459 | + |
| 460 | + public IActionResult SignOutWithAuthenticationSchemes() |
| 461 | + { |
| 462 | + return this.SignOut(AuthenticationScheme.Basic, AuthenticationScheme.NTLM); |
| 463 | + } |
| 464 | + |
| 465 | + public IActionResult SignOutWithAuthenticationProperties() |
| 466 | + { |
| 467 | + return this.SignOut(TestObjectFactory.GetAuthenticationProperties()); |
| 468 | + } |
| 469 | + |
444 | 470 | public FileResult FileWithVirtualPath()
|
445 | 471 | {
|
446 | 472 | return this.File("/Test", ContentType.ApplicationJson, "FileDownloadName");
|
|
0 commit comments