5
5
using System . Security . Claims ;
6
6
using System . Threading . Tasks ;
7
7
using Microsoft . AspNet . Http . Features . Authentication ;
8
+ using Microsoft . Framework . Internal ;
8
9
9
10
namespace Microsoft . AspNet . Http . Authentication
10
11
{
11
12
public abstract class AuthenticationManager
12
13
{
13
14
public abstract IEnumerable < AuthenticationDescription > GetAuthenticationSchemes ( ) ;
14
15
15
- public abstract Task AuthenticateAsync ( AuthenticateContext context ) ;
16
+ public abstract Task AuthenticateAsync ( [ NotNull ] AuthenticateContext context ) ;
16
17
17
- public async Task < ClaimsPrincipal > AuthenticateAsync ( string authenticationScheme )
18
+ public async Task < ClaimsPrincipal > AuthenticateAsync ( [ NotNull ] string authenticationScheme )
18
19
{
19
20
var context = new AuthenticateContext ( authenticationScheme ) ;
20
21
await AuthenticateAsync ( context ) ;
@@ -31,47 +32,47 @@ public virtual Task ChallengeAsync(AuthenticationProperties properties)
31
32
return ChallengeAsync ( authenticationScheme : null , properties : properties ) ;
32
33
}
33
34
34
- public virtual Task ChallengeAsync ( string authenticationScheme )
35
+ public virtual Task ChallengeAsync ( [ NotNull ] string authenticationScheme )
35
36
{
36
37
return ChallengeAsync ( authenticationScheme : authenticationScheme , properties : null ) ;
37
38
}
38
39
39
40
// Leave it up to authentication handler to do the right thing for the challenge
40
- public Task ChallengeAsync ( string authenticationScheme , AuthenticationProperties properties )
41
+ public Task ChallengeAsync ( [ NotNull ] string authenticationScheme , AuthenticationProperties properties )
41
42
{
42
43
return ChallengeAsync ( authenticationScheme , properties , ChallengeBehavior . Automatic ) ;
43
44
}
44
45
45
- public Task SignInAsync ( string authenticationScheme , ClaimsPrincipal principal )
46
+ public Task SignInAsync ( [ NotNull ] string authenticationScheme , ClaimsPrincipal principal )
46
47
{
47
48
return SignInAsync ( authenticationScheme , principal , properties : null ) ;
48
49
}
49
50
50
- public Task ForbidAsync ( string authenticationScheme )
51
+ public Task ForbidAsync ( [ NotNull ] string authenticationScheme )
51
52
{
52
53
return ForbidAsync ( authenticationScheme , properties : null ) ;
53
54
}
54
55
55
56
// Deny access (typically a 403)
56
- public Task ForbidAsync ( string authenticationScheme , AuthenticationProperties properties )
57
+ public Task ForbidAsync ( [ NotNull ] string authenticationScheme , AuthenticationProperties properties )
57
58
{
58
59
return ChallengeAsync ( authenticationScheme , properties , ChallengeBehavior . Forbidden ) ;
59
60
}
60
61
61
- public abstract Task ChallengeAsync ( string authenticationScheme , AuthenticationProperties properties , ChallengeBehavior behavior ) ;
62
+ public abstract Task ChallengeAsync ( [ NotNull ] string authenticationScheme , AuthenticationProperties properties , ChallengeBehavior behavior ) ;
62
63
63
- public abstract Task SignInAsync ( string authenticationScheme , ClaimsPrincipal principal , AuthenticationProperties properties ) ;
64
+ public abstract Task SignInAsync ( [ NotNull ] string authenticationScheme , ClaimsPrincipal principal , AuthenticationProperties properties ) ;
64
65
65
66
public Task SignOutAsync ( )
66
67
{
67
68
return SignOutAsync ( authenticationScheme : null , properties : null ) ;
68
69
}
69
70
70
- public Task SignOutAsync ( string authenticationScheme )
71
+ public Task SignOutAsync ( [ NotNull ] string authenticationScheme )
71
72
{
72
73
return SignOutAsync ( authenticationScheme , properties : null ) ;
73
74
}
74
75
75
- public abstract Task SignOutAsync ( string authenticationScheme , AuthenticationProperties properties ) ;
76
+ public abstract Task SignOutAsync ( [ NotNull ] string authenticationScheme , AuthenticationProperties properties ) ;
76
77
}
77
78
}
0 commit comments