// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.AspNet.Http; namespace Microsoft.AspNet.Authentication.Notifications { public class BaseNotification : BaseContext { protected BaseNotification(HttpContext context, TOptions options) : base(context, options) { } public NotificationResultState State { get; set; } public bool HandledResponse { get { return State == NotificationResultState.HandledResponse; } } public bool Skipped { get { return State == NotificationResultState.Skipped; } } /// /// Discontinue all processing for this request and return to the client. /// The caller is responsible for generating the full response. /// Set the to trigger SignIn. /// public void HandleResponse() { State = NotificationResultState.HandledResponse; } /// /// Discontinue processing the request in the current middleware and pass control to the next one. /// SignIn will not be called. /// public void SkipToNextMiddleware() { State = NotificationResultState.Skipped; } /// /// Gets or set the to return if this notification signals it handled the notification. /// public AuthenticationTicket AuthenticationTicket { get; set; } } }