Sprache

MicrosoftIdentityAuthenticationException Konstruktoren

Definition

Überlädt

Name Beschreibung
MicrosoftIdentityAuthenticationException(String)

Initialisiert eine neue Instanz der MicrosoftIdentityAuthenticationException Klasse mit einer angegebenen Fehlermeldung.

MicrosoftIdentityAuthenticationException(String, Exception)

Initialisiert eine neue Instanz der MicrosoftIdentityAuthenticationException Klasse mit einer angegebenen Fehlermeldung und einem Verweis auf die innere Ausnahme, die die Ursache dieser Ausnahme ist.

MicrosoftIdentityAuthenticationException(String)

Initialisiert eine neue Instanz der MicrosoftIdentityAuthenticationException Klasse mit einer angegebenen Fehlermeldung.

public MicrosoftIdentityAuthenticationException(string message);
new Microsoft.Identity.Web.MicrosoftIdentityAuthenticationException : string -> Microsoft.Identity.Web.MicrosoftIdentityAuthenticationException
Public Sub New (message As String)

Parameter

message
String

Die Fehlermeldung, die den Grund für die Ausnahme erklärt.

Beispiele

throw new MicrosoftIdentityAuthenticationException(
    "Authentication options must be configured either in default options or per-request using WithAuthenticationOptions().");

Gilt für:

MicrosoftIdentityAuthenticationException(String, Exception)

Initialisiert eine neue Instanz der MicrosoftIdentityAuthenticationException Klasse mit einer angegebenen Fehlermeldung und einem Verweis auf die innere Ausnahme, die die Ursache dieser Ausnahme ist.

public MicrosoftIdentityAuthenticationException(string message, Exception innerException);
new Microsoft.Identity.Web.MicrosoftIdentityAuthenticationException : string * Exception -> Microsoft.Identity.Web.MicrosoftIdentityAuthenticationException
Public Sub New (message As String, innerException As Exception)

Parameter

message
String

Die Fehlermeldung, die den Grund für die Ausnahme erklärt.

innerException
Exception

Die Ausnahme, die die Ursache der aktuellen Ausnahme ist oder null wenn keine innere Ausnahme angegeben ist.

Beispiele

try
{
    var authHeader = await headerProvider.CreateAuthorizationHeaderAsync(scopes, options);
}
catch (Exception ex)
{
    throw new MicrosoftIdentityAuthenticationException("Failed to acquire authorization header.", ex);
}

Hinweise

Verwenden Sie diesen Konstruktor, wenn Sie die ursprüngliche Ausnahme beibehalten möchten, die den Authentifizierungsfehler verursacht hat, z. B. Ausnahmen vom zugrunde liegenden Tokenerwerbsanbieter.

Gilt für: