-
Notifications
You must be signed in to change notification settings - Fork 4.9k
/
AuthenticationRequiredException.cs
53 lines (48 loc) · 2.18 KB
/
AuthenticationRequiredException.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) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System;
using System.Runtime.Serialization;
using Azure.Core;
namespace Azure.Identity
{
/// <summary>
/// An exception indicating that interactive authentication is required.
/// </summary>
[Serializable]
public class AuthenticationRequiredException : CredentialUnavailableException
{
/// <summary>
/// Creates a new <see cref="AuthenticationRequiredException"/> with the specified message and context.
/// </summary>
/// <param name="message">The message describing the authentication failure.</param>
/// <param name="context">The details of the authentication request.</param>
public AuthenticationRequiredException(string message, TokenRequestContext context)
: this(message, context, default)
{
}
/// <summary>
/// Creates a new <see cref="AuthenticationRequiredException"/> with the specified message, context and inner exception.
/// </summary>
/// <param name="message">The message describing the authentication failure.</param>
/// <param name="context">The details of the authentication request.</param>
/// <param name="innerException">The exception underlying the authentication failure.</param>
public AuthenticationRequiredException(string message, TokenRequestContext context, Exception innerException)
: base(message, innerException)
{
TokenRequestContext = context;
}
/// <summary>
/// A constructor used for serialization.
/// </summary>
/// <param name="info">The <see cref="SerializationInfo"/>.</param>
/// <param name="context">The <see cref="StreamingContext"/>.</param>
/// <returns></returns>
protected AuthenticationRequiredException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
/// <summary>
/// The details of the authentication request which resulted in the authentication failure.
/// </summary>
public TokenRequestContext TokenRequestContext { get; }
}
}