// 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.Threading.Tasks;
namespace Microsoft.AspNet.Authentication.OAuth
{
///
/// Specifies callback methods which the invokes to enable developer control over the authentication process.
///
public interface IOAuthEvents
{
///
/// Invoked after the provider successfully authenticates a user. This can be used to retrieve user information.
/// This event may not be invoked by sub-classes of OAuthAuthenticationHandler if they override CreateTicketAsync.
///
/// Contains information about the login session.
/// A representing the completed operation.
Task CreatingTicket(OAuthCreatingTicketContext context);
///
/// Invoked prior to the being saved in a local cookie and the browser being redirected to the originally requested URL.
///
///
/// A representing the completed operation.
Task SigningIn(SigningInContext context);
///
/// Called when a Challenge causes a redirect to the authorize endpoint.
///
/// Contains redirect URI and of the challenge.
Task RedirectToAuthorizationEndpoint(OAuthRedirectToAuthorizationContext context);
}
}