Repository navigation
Expand file tree
/
Copy pathBaseNotification.cs
More file actions
51 lines (42 loc) · 1.7 KB
/
Copy pathBaseNotification.cs
File metadata and controls
51 lines (42 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// 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<TOptions> : BaseContext<TOptions>
{
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; }
}
/// <summary>
/// Discontinue all processing for this request and return to the client.
/// The caller is responsible for generating the full response.
/// Set the <see cref="AuthenticationTicket"/> to trigger SignIn.
/// </summary>
public void HandleResponse()
{
State = NotificationResultState.HandledResponse;
}
/// <summary>
/// Discontinue processing the request in the current middleware and pass control to the next one.
/// SignIn will not be called.
/// </summary>
public void SkipToNextMiddleware()
{
State = NotificationResultState.Skipped;
}
/// <summary>
/// Gets or set the <see cref="AuthenticationTicket"/> to return if this notification signals it handled the notification.
/// </summary>
public AuthenticationTicket AuthenticationTicket { get; set; }
}
}