<PackageReference Include="Microsoft.Identity.Client" Version="4.84.2-preview" />

Microsoft.Identity.Client.MsalException

public class MsalException : Exception
Base exception type thrown when an error occurs during token acquisition. For more details, see https://aka.ms/msal-net-exceptions
public const string BrokerErrorCode = "BrokerErrorCode"

An AdditionalExceptionData property key, available when using desktop brokers.

public const string BrokerErrorContext = "BrokerErrorContext"

An AdditionalExceptionData property key, available when using desktop brokers.

public const string BrokerErrorStatus = "BrokerErrorStatus"

An AdditionalExceptionData property key, available when using desktop brokers.

public const string BrokerErrorTag = "BrokerErrorTag"

An AdditionalExceptionData property key, available when using desktop brokers.

public const string BrokerTelemetry = "BrokerTelemetry"

An AdditionalExceptionData property key, available when using desktop brokers.

public const string ManagedIdentitySource = "ManagedIdentitySource"

An AdditionalExceptionData property key, available when using managed identity.

public IReadOnlyDictionary<string, string> AdditionalExceptionData { get; set; }

A property bag with extra details for this exception.

public string CorrelationId { get; set; }

An ID that can used to piece up a single authentication flow.

public string ErrorCode { get; }

Gets the protocol error code returned by the service or generated by the client. This is the code you can rely on for exception handling. Values for this code are typically provided in constant strings in the derived exceptions types with explanations of mitigation.

public bool IsRetryable { get; set; }

Indicates if the previous operation that resulted in this exception should be retried.

public MsalException()

Initializes a new instance of the exception class.

public MsalException(string errorCode)

Initializes a new instance of the exception class with a specified error code.

public MsalException(string errorCode, string errorMessage)

Initializes a new instance of the exception class with a specified error code and error message.

public MsalException(string errorCode, string errorMessage, Exception innerException)

Initializes a new instance of the exception class with a specified error code and a reference to the inner exception that is the cause of this exception.

public static MsalException FromJsonString(string json)

Allows re-hydration of the MsalException (or one of its derived types) from JSON generated by ToJsonString().

public string ToJsonString()

Allows serialization of most values of the exception into JSON.