// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Security.Claims;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
namespace Microsoft.AspNetCore.Authentication
{
///
/// Created per request to handle authentication for to a particular scheme.
///
public interface IAuthenticationHandler
{
///
/// The handler should initialize anything it needs from the request and scheme here.
///
/// The scheme.
/// The context.
///
Task InitializeAsync(AuthenticationScheme scheme, HttpContext context);
///
/// Authentication behavior.
///
/// The result.
Task AuthenticateAsync();
///
/// Challenge behavior.
///
/// The that contains the extra meta-data arriving with the authentication.
/// A task.
Task ChallengeAsync(AuthenticationProperties properties);
///
/// Forbid behavior.
///
/// The that contains the extra meta-data arriving with the authentication.
/// A task.
Task ForbidAsync(AuthenticationProperties properties);
///
/// Handle sign in.
///
/// The user.
/// The that contains the extra meta-data arriving with the authentication.
/// A task.
Task SignInAsync(ClaimsPrincipal user, AuthenticationProperties properties);
///
/// Signout behavior.
///
/// The that contains the extra meta-data arriving with the authentication.
/// A task.
Task SignOutAsync(AuthenticationProperties properties);
}
}