Search Results for

    Show / Hide Table of Contents

    Class MySqlAuthenticationPlugin

    Defines the default behavior for an authentication plugin.

    Inheritance
    System.Object
    MySqlAuthenticationPlugin
    MySqlClearPasswordPlugin
    MySqlNativePasswordPlugin
    Namespace: MySql.Data.MySqlClient.Authentication
    Assembly: MySql.Data.dll
    Version: 9.3.0
    Syntax
    public abstract class MySqlAuthenticationPlugin

    Fields

    AuthenticationData

    Gets or sets the authentication data returned by the server.

    Declaration
    protected byte[] AuthenticationData
    Field Value
    Type Description
    System.Byte[]

    Properties

    Encoding

    Gets the encoding assigned to the native driver.

    Declaration
    protected Encoding Encoding { get; }
    Property Value
    Type Description
    System.Text.Encoding

    PluginName

    Gets the plugin name based on the authentication plugin type defined during the creation of this object.

    Declaration
    public abstract string PluginName { get; }
    Property Value
    Type Description
    System.String

    ServerVersion

    Gets the server version associated with this authentication plugin.

    Declaration
    protected Version ServerVersion { get; }
    Property Value
    Type Description
    System.Version

    Settings

    Gets the connection option settings.

    Declaration
    protected MySqlConnectionStringBuilder Settings { get; }
    Property Value
    Type Description
    MySqlConnectionStringBuilder

    Methods

    AuthenticationFailed(MySqlException)

    Throws a MySqlException that encapsulates the original exception.

    Declaration
    protected virtual void AuthenticationFailed(MySqlException ex)
    Parameters
    Type Name Description
    MySqlException ex

    The exception to encapsulate.

    AuthenticationSuccessful()

    Defines the behavior when authentication is successful.

    Declaration
    protected virtual void AuthenticationSuccessful()
    Remarks

    This method is intended to be overriden.

    CheckConstraints()

    Defines the behavior when checking for constraints.

    Declaration
    protected virtual void CheckConstraints()
    Remarks

    This method is intended to be overriden.

    GetMFAPassword()

    Gets the password for the iteration of the multifactor authentication

    Declaration
    protected string GetMFAPassword()
    Returns
    Type Description
    System.String

    A password

    GetPassword()

    Gets the encoded, encrypted, or converted password based on the authentication plugin type defined during the creation of this object. This method is intended to be overriden.

    Declaration
    public virtual object GetPassword()
    Returns
    Type Description
    System.Object

    An object containing the encoded, encrypted, or converted password.

    GetUsername()

    Gets the user name associated to the connection settings.

    Declaration
    public virtual string GetUsername()
    Returns
    Type Description
    System.String

    The user name associated to the connection settings.

    MoreDataAsync(Byte[], Boolean)

    Defines the behavior when more data is required from the server.

    Declaration
    protected virtual Task<byte[]> MoreDataAsync(byte[] data, bool execAsync)
    Parameters
    Type Name Description
    System.Byte[] data

    The data returned by the server.

    System.Boolean execAsync

    Boolean that indicates if the function will be executed asynchronously.

    Returns
    Type Description
    System.Threading.Tasks.Task<System.Byte[]>

    The data to return to the server.

    Remarks

    This method is intended to be overriden.

    SetAuthData(Byte[])

    Sets the authentication data required to encode, encrypt, or convert the password of the user.

    Declaration
    protected virtual void SetAuthData(byte[] data)
    Parameters
    Type Name Description
    System.Byte[] data

    A byte array containing the authentication data provided by the server.

    Remarks

    This method may be overriden based on the requirements by the implementing authentication plugin.

    In This Article
    • Fields
      • AuthenticationData
    • Properties
      • Encoding
      • PluginName
      • ServerVersion
      • Settings
    • Methods
      • AuthenticationFailed(MySqlException)
      • AuthenticationSuccessful()
      • CheckConstraints()
      • GetMFAPassword()
      • GetPassword()
      • GetUsername()
      • MoreDataAsync(Byte[], Boolean)
      • SetAuthData(Byte[])
    Back to top Copyright © 2021, 2025, Oracle and/or its affiliates.