System.Net.Security.AuthenticationException Class

Represents errors that occur during authentication.

Namespace: System.Net.Security
Assembly: System.Net.Primitives (in .NET Core), System (in .NET Framework)

Introduction

The AuthenticationException class is a specific exception type used to indicate that an error has occurred during the process of authenticating a network connection. This typically happens when security protocols or credentials fail, preventing a secure and trusted communication channel from being established.

Common scenarios where this exception might be thrown include:

Syntax

The following shows the syntax for the AuthenticationException class:


[SerializableAttribute]
public class AuthenticationException : SystemException
{
    // Fields
    // Constructors
    // Properties
    // Methods
}
            

Fields

The AuthenticationException class does not declare any public static fields.

Constructors

AuthenticationException()

Initializes a new instance of the AuthenticationException class.

public AuthenticationException();

AuthenticationException(string message)

Initializes a new instance of the AuthenticationException class with a specified error message.

public AuthenticationException(string message);

AuthenticationException(string message, Exception innerException)

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

public AuthenticationException(string message, Exception innerException);

Properties

In addition to the members inherited from SystemException, the AuthenticationException class exposes no additional properties.

Methods

The AuthenticationException class does not override any methods from its base class and does not declare any new methods.

Inheritance Hierarchy

Object
  Exception
    SystemException
      AuthenticationException

Requirements

Supported in:

  • .NET Core 2.0
  • .NET Framework 4.5
  • .NET Standard 1.3
  • UWP

Frameworks:

  • .NET Core
  • .NET Framework
  • .NET Standard
  • Universal Windows Platform (UWP)

See Also