Class MySqlAuthenticationPlugin
Defines the default behavior for an authentication plugin.
Inheritance
Namespace: MySql.Data.MySqlClient.Authentication
Assembly: MySql.Data.dll
Version: 9.2.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. |
Properties
Encoding
Gets the encoding assigned to the native driver.
Declaration
protected Encoding Encoding { get; }
Property Value
Type | Description |
---|---|
System. |
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. |
ServerVersion
Gets the server version associated with this authentication plugin.
Declaration
protected Version ServerVersion { get; }
Property Value
Type | Description |
---|---|
System. |
Settings
Gets the connection option settings.
Declaration
protected MySqlConnectionStringBuilder Settings { get; }
Property Value
Type | Description |
---|---|
My |
Methods
AuthenticationFailed(MySqlException)
Throws a My
Declaration
protected virtual void AuthenticationFailed(MySqlException ex)
Parameters
Type | Name | Description |
---|---|---|
My |
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. |
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. |
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. |
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. |
data | The data returned by the server. |
System. |
execAsync | Boolean that indicates if the function will be executed asynchronously. |
Returns
Type | Description |
---|---|
System. |
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. |
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.