/
JwtBearerChallengeContext.cs
53 lines (45 loc) · 2.02 KB
/
JwtBearerChallengeContext.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
44
45
46
47
48
49
50
51
52
53
// 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;
using Microsoft.AspNetCore.Http;
namespace Microsoft.AspNetCore.Authentication.JwtBearer
{
public class JwtBearerChallengeContext : PropertiesContext<JwtBearerOptions>
{
public JwtBearerChallengeContext(
HttpContext context,
AuthenticationScheme scheme,
JwtBearerOptions options,
AuthenticationProperties properties)
: base(context, scheme, options, properties) { }
/// <summary>
/// Any failures encountered during the authentication process.
/// </summary>
public Exception AuthenticateFailure { get; set; }
/// <summary>
/// Gets or sets the "error" value returned to the caller as part
/// of the WWW-Authenticate header. This property may be null when
/// <see cref="JwtBearerOptions.IncludeErrorDetails"/> is set to <c>false</c>.
/// </summary>
public string Error { get; set; }
/// <summary>
/// Gets or sets the "error_description" value returned to the caller as part
/// of the WWW-Authenticate header. This property may be null when
/// <see cref="JwtBearerOptions.IncludeErrorDetails"/> is set to <c>false</c>.
/// </summary>
public string ErrorDescription { get; set; }
/// <summary>
/// Gets or sets the "error_uri" value returned to the caller as part of the
/// WWW-Authenticate header. This property is always null unless explicitly set.
/// </summary>
public string ErrorUri { get; set; }
/// <summary>
/// If true, will skip any default logic for this challenge.
/// </summary>
public bool Handled { get; private set; }
/// <summary>
/// Skips any default logic for this challenge.
/// </summary>
public void HandleResponse() => Handled = true;
}
}