-
Notifications
You must be signed in to change notification settings - Fork 9.8k
/
RedirectContext.cs
43 lines (37 loc) · 1.56 KB
/
RedirectContext.cs
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
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using Microsoft.AspNetCore.Http;
using Microsoft.IdentityModel.Protocols.WsFederation;
namespace Microsoft.AspNetCore.Authentication.WsFederation;
/// <summary>
/// When a user configures the <see cref="WsFederationHandler"/> to be notified prior to redirecting to an IdentityProvider
/// an instance of <see cref="RedirectContext"/> is passed to the 'RedirectToAuthenticationEndpoint' or 'RedirectToEndSessionEndpoint' events.
/// </summary>
public class RedirectContext : PropertiesContext<WsFederationOptions>
{
/// <summary>
/// Creates a new context object.
/// </summary>
/// <param name="context"></param>
/// <param name="scheme"></param>
/// <param name="options"></param>
/// <param name="properties"></param>
public RedirectContext(
HttpContext context,
AuthenticationScheme scheme,
WsFederationOptions options,
AuthenticationProperties? properties)
: base(context, scheme, options, properties) { }
/// <summary>
/// The <see cref="WsFederationMessage"/> used to compose the redirect.
/// </summary>
public WsFederationMessage ProtocolMessage { get; set; } = default!;
/// <summary>
/// If true, will skip any default logic for this redirect.
/// </summary>
public bool Handled { get; private set; }
/// <summary>
/// Skips any default logic for this redirect.
/// </summary>
public void HandleResponse() => Handled = true;
}