@@ -17,30 +17,6 @@ public class AuthenticationTests
17
17
private static bool AllowAnoymous = true ;
18
18
private static bool DenyAnoymous = false ;
19
19
20
- [ ConditionalTheory ]
21
- [ InlineData ( AuthenticationSchemes . Negotiate ) ]
22
- [ InlineData ( AuthenticationSchemes . NTLM ) ]
23
- [ InlineData ( AuthenticationSchemes . Basic ) ]
24
- [ InlineData ( AuthenticationSchemes . Negotiate | AuthenticationSchemes . NTLM | /*AuthenticationSchemes.Digest |*/ AuthenticationSchemes . Basic ) ]
25
- public async Task CanAuthenticate ( AuthenticationSchemes authType )
26
- {
27
- var authTypeList = authType . ToString ( ) . Split ( new char [ ] { ',' , ' ' } , StringSplitOptions . RemoveEmptyEntries ) ;
28
- using ( var server = Utilities . CreateDynamicHost ( string . Empty , authType , AllowAnoymous , out var address , out var baseAddress , async httpContext =>
29
- {
30
- foreach ( var scheme in authTypeList )
31
- {
32
- var result = await httpContext . AuthenticateAsync ( scheme ) ;
33
- Assert . True ( result . Succeeded ) ;
34
- }
35
- httpContext . Response . StatusCode = 200 ;
36
- } ) )
37
- {
38
- var response = await SendRequestAsync ( address ) ;
39
- Assert . NotNull ( response ) ;
40
- Assert . Equal ( HttpStatusCode . OK , response . StatusCode ) ;
41
- }
42
- }
43
-
44
20
[ ConditionalTheory ]
45
21
[ InlineData ( AuthenticationSchemes . None ) ]
46
22
[ InlineData ( AuthenticationSchemes . Negotiate ) ]
@@ -176,7 +152,7 @@ public async Task AuthTypes_AllowAnonymousButSpecify401_Success(AuthenticationSc
176
152
[ InlineData ( AuthenticationSchemes . Negotiate | AuthenticationSchemes . NTLM | /* AuthenticationSchemes.Digest |*/ AuthenticationSchemes . Basic ) ]
177
153
public async Task AuthTypes_RequireAuth_Success ( AuthenticationSchemes authType )
178
154
{
179
- using ( var server = Utilities . CreateDynamicHost ( string . Empty , authType , AllowAnoymous , out var address , out var baseAddress , httpContext =>
155
+ using ( var server = Utilities . CreateDynamicHost ( string . Empty , authType , DenyAnoymous , out var address , out var baseAddress , httpContext =>
180
156
{
181
157
Assert . NotNull ( httpContext . User ) ;
182
158
Assert . NotNull ( httpContext . User . Identity ) ;
0 commit comments