| | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 2 | | // Licensed under the MIT License. |
| | 3 | |
|
| | 4 | | using System; |
| | 5 | | using Azure.Core; |
| | 6 | |
|
| | 7 | | namespace Azure.Identity |
| | 8 | | { |
| | 9 | | /// <summary> |
| | 10 | | /// An exception indicating that interactive authentication is required. |
| | 11 | | /// </summary> |
| | 12 | | internal class AuthenticationRequiredException : CredentialUnavailableException |
| | 13 | | { |
| | 14 | | /// <summary> |
| | 15 | | /// Creates a new <see cref="AuthenticationRequiredException"/> with the specified message and context. |
| | 16 | | /// </summary> |
| | 17 | | /// <param name="message">The message describing the authentication failure.</param> |
| | 18 | | /// <param name="context">The details of the authentication request.</param> |
| | 19 | | public AuthenticationRequiredException(string message, TokenRequestContext context) |
| 0 | 20 | | : this(message, context, default) |
| | 21 | | { |
| | 22 | |
|
| 0 | 23 | | } |
| | 24 | |
|
| | 25 | | /// <summary> |
| | 26 | | /// Creates a new <see cref="AuthenticationRequiredException"/> with the specified message, context and inner ex |
| | 27 | | /// </summary> |
| | 28 | | /// <param name="message">The message describing the authentication failure.</param> |
| | 29 | | /// <param name="context">The details of the authentication request.</param> |
| | 30 | | /// <param name="innerException">The exception underlying the authentication failure.</param> |
| | 31 | | public AuthenticationRequiredException(string message, TokenRequestContext context, Exception innerException) |
| 8 | 32 | | : base(message, innerException) |
| | 33 | | { |
| 8 | 34 | | TokenRequestContext = context; |
| 8 | 35 | | } |
| | 36 | |
|
| | 37 | | /// <summary> |
| | 38 | | /// The details of the authentication request which resulted in the authentication failure. |
| | 39 | | /// </summary> |
| 8 | 40 | | public TokenRequestContext TokenRequestContext { get; } |
| | 41 | | } |
| | 42 | | } |