diff --git a/src/Microsoft.AspNet.Http.Abstractions/Authentication/AuthenticationManager.cs b/src/Microsoft.AspNet.Http.Abstractions/Authentication/AuthenticationManager.cs index 497ad3e25d..687e1c7474 100644 --- a/src/Microsoft.AspNet.Http.Abstractions/Authentication/AuthenticationManager.cs +++ b/src/Microsoft.AspNet.Http.Abstractions/Authentication/AuthenticationManager.cs @@ -78,6 +78,13 @@ namespace Microsoft.AspNet.Http.Authentication return SignInAsync(authenticationScheme, principal, properties: null); } + /// + /// Creates a challenge for the authentication manager with . + /// + /// A that represents the asynchronous challenge operation. + public virtual Task ForbidAsync() + => ForbidAsync(AutomaticScheme, properties: null); + public virtual Task ForbidAsync(string authenticationScheme) { if (authenticationScheme == null) @@ -99,6 +106,14 @@ namespace Microsoft.AspNet.Http.Authentication return ChallengeAsync(authenticationScheme, properties, ChallengeBehavior.Forbidden); } + /// + /// Creates a challenge for the authentication manager with . + /// + /// Additional arbitrary values which may be used by particular authentication types. + /// A that represents the asynchronous challenge operation. + public virtual Task ForbidAsync(AuthenticationProperties properties) + => ForbidAsync(AutomaticScheme, properties); + public abstract Task ChallengeAsync(string authenticationScheme, AuthenticationProperties properties, ChallengeBehavior behavior); public abstract Task SignInAsync(string authenticationScheme, ClaimsPrincipal principal, AuthenticationProperties properties);