| Modifier and Type | Field and Description |
|---|---|
| private static final int | |
| private Map | authenticationPlugins
Contains instances of authentication plugins that implements |
| private MysqlCallbackHandler | callbackHandler
A callback for updating the username from the authentication plugin. |
| private boolean | clientDefaultAuthenticationPluginExplicitelySet
Was the client default authentication plugin explicitly set? |
| private String | clientDefaultAuthenticationPluginName
Protocol name of default authentication plugin in client |
| private String | |
| private ExceptionInterceptor | |
| private static final String | |
| private String | |
| private PropertySet | |
| private Protocol | |
| private String | |
| private String | serverDefaultAuthenticationPluginName
Protocol name of default authentication plugin in server |
| private boolean | |
| private String |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| public void | changeUser(String
user name user, String password pass, String database name db)Implements com. Re-authenticates as the given user and password |
| private void | checkConfidentiality(AuthenticationPlugin<?> plugin)
Check if given plugin requires confidentiality, but connection is without SSL |
| public void | connect(String
user name user, String password pass, String database name db)Implements com. Initialize communications with the MySQL server. |
| private NativePacketPayload | createChangeUserPacket(ServerSession serverSession, String pluginName, NativePacketPayload authData)
|
| private NativePacketPayload | createHandshakeResponsePacket(ServerSession serverSession, String pluginName, NativePacketPayload authData)
|
| private AuthenticationPlugin | Returns: null if plugin is not found or authentication plugin instance initialized with current connection propertiesmysql protocol plugin names, for example "caching_sha2_password" and "mysql_native_password" for built-in plugins pluginName)Get an authentication plugin instance from the authentication plugins map by pluginName key. |
| private Map | |
| public ExceptionInterceptor | |
| private String | |
| public void | init(Protocol<NativePacketPayload> prot, PropertySet propSet, ExceptionInterceptor excInterceptor)
Implements com.
|
| private void | |
| private void | proceedHandshakeWithPluggableAuthentication(final NativePacketPayload
the Auth Challenge Packet received from server if
this method is used during the initial connection.
Otherwise null. challenge)Performs an authentication handshake to authorize connection to a given database as a given MySQL user. |
| AUTH_411_OVERHEAD | back to summary |
|---|---|
| private static final int AUTH_411_OVERHEAD | |
| authenticationPlugins | back to summary |
|---|---|
| private Map<String, AuthenticationPlugin<NativePacketPayload>> authenticationPlugins Contains instances of authentication plugins that implements | |
| callbackHandler | back to summary |
|---|---|
| private MysqlCallbackHandler callbackHandler A callback for updating the username from the authentication plugin. | |
| clientDefaultAuthenticationPluginExplicitelySet | back to summary |
|---|---|
| private boolean clientDefaultAuthenticationPluginExplicitelySet Was the client default authentication plugin explicitly set? | |
| clientDefaultAuthenticationPluginName | back to summary |
|---|---|
| private String clientDefaultAuthenticationPluginName Protocol name of default authentication plugin in client | |
| database | back to summary |
|---|---|
| private String database | |
| exceptionInterceptor | back to summary |
|---|---|
| private ExceptionInterceptor exceptionInterceptor | |
| NONE | back to summary |
|---|---|
| private static final String NONE | |
| password | back to summary |
|---|---|
| private String password | |
| propertySet | back to summary |
|---|---|
| private PropertySet propertySet | |
| protocol | back to summary |
|---|---|
| private Protocol<NativePacketPayload> protocol | |
| seed | back to summary |
|---|---|
| private String seed | |
| serverDefaultAuthenticationPluginName | back to summary |
|---|---|
| private String serverDefaultAuthenticationPluginName Protocol name of default authentication plugin in server | |
| useConnectWithDb | back to summary |
|---|---|
| private boolean useConnectWithDb | |
| username | back to summary |
|---|---|
| private String username | |
| NativeAuthenticationProvider | back to summary |
|---|---|
| public NativeAuthenticationProvider() | |
| appendConnectionAttributes | back to summary |
|---|---|
| private void appendConnectionAttributes(NativePacketPayload buf, String attributes, String enc) | |
| changeUser | back to summary |
|---|---|
| public void changeUser(String user, String pass, String db) Implements com. Re-authenticates as the given user and password | |
| checkConfidentiality | back to summary |
|---|---|
| private void checkConfidentiality(AuthenticationPlugin<?> plugin) Check if given plugin requires confidentiality, but connection is without SSL
| |
| connect | back to summary |
|---|---|
| public void connect(String user, String pass, String db) Implements com. Initialize communications with the MySQL server. Handles logging on, and handling initial connection errors. | |
| createChangeUserPacket | back to summary |
|---|---|
| private NativePacketPayload createChangeUserPacket(ServerSession serverSession, String pluginName, NativePacketPayload authData) | |
| createHandshakeResponsePacket | back to summary |
|---|---|
| private NativePacketPayload createHandshakeResponsePacket(ServerSession serverSession, String pluginName, NativePacketPayload authData) | |
| getAuthenticationPlugin | back to summary |
|---|---|
| private AuthenticationPlugin Get an authentication plugin instance from the authentication plugins map by pluginName key. If such plugin is found, its method
| |
| getConnectionAttributesMap | back to summary |
|---|---|
| private Map | |
| getExceptionInterceptor | back to summary |
|---|---|
| public ExceptionInterceptor getExceptionInterceptor() | |
| getNthFactorPassword | back to summary |
|---|---|
| private String getNthFactorPassword(int nthFactor) | |
| init | back to summary |
|---|---|
| public void init(Protocol<NativePacketPayload> prot, PropertySet propSet, ExceptionInterceptor excInterceptor) Implements com.
| |
| loadAuthenticationPlugins | back to summary |
|---|---|
| private void loadAuthenticationPlugins() Fill the authentication plugins map.
Starts by filling the map with instances of the built-in authentication plugins. Then creates instances of plugins listed in the "authenticationPlugins"
connection property and adds them to the map too.
The plugins map uses the plugin names as keys, which are obtained from
| |
| proceedHandshakeWithPluggableAuthentication | back to summary |
|---|---|
| private void proceedHandshakeWithPluggableAuthentication(final NativePacketPayload challenge) Performs an authentication handshake to authorize connection to a given database as a given MySQL user. This can happen upon initial connection to the server, after receiving Auth Challenge Packet, or at any moment during the connection life-time via a Change User request. This method will use registered authentication plugins as requested by the server.
| |