Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-26715

Windows - passwordless login for mariadb root user, for OS admin users

Details

    Description

      On Linux, root user does not need a password to login, if connection is made using Unix socket. The authentication plugin unix_socket makes it possible. If the connection with unix_socket fails, root will fallback to native_authentication.

      The purpose of this task is to make the same possible on Windows. There is already a gssapi plugin, which can detect users with administrative privileges (with MDEV-23959 one can use e.g "SID:BA" in user definition to allow administrator only).

      There is a subtlety with this plugin, which is not there with unix socket. The unix_socket does not send any packets between client and server, i.e it does not need client support.
      auth_gssapi on the other hand does need client support, and there will be lot of auth_gssapi unaware clients drivers (basically, everything except our own 3 drivers and MySqlConnector.NET.
      Also, most of 3rd drivers are unaware of "switch authentication" which is used with alternative authentication methods in MariaDB.

      Thus, to avoid failures when mariadb is used with 3rd party driver, authentication on Windows should try password-based native_authentication first, and only if it fails, fallback to passwordless auth_gssapi.

      Note, that auth_gssapi and its client portion should be linked into the server and C client, to avoid different scenarios where plugin would not be found.

      Attachments

        Issue Links

          Activity

            Would be nice to know in course of testing

            With normal installation (MSI), check how foreign (non-MariaDB) connectors behave, when connecting as user root with wrong password. Oracle's C, JDBC and .NET driver, could be used for this kind of testing.
            The interesting part is how do foreign connectors react to switch authentication from mysql_native_authentication to auth_gssapi_client. Failure like "auth_gssapi_client plugin not found", that should be fine and expected. Hopefully those connectors won't crash in unforeseen ways.

            wlad Vladislav Vaintroub added a comment - Would be nice to know in course of testing With normal installation (MSI), check how foreign (non-MariaDB) connectors behave, when connecting as user root with wrong password. Oracle's C, JDBC and .NET driver, could be used for this kind of testing. The interesting part is how do foreign connectors react to switch authentication from mysql_native_authentication to auth_gssapi_client. Failure like "auth_gssapi_client plugin not found", that should be fine and expected. Hopefully those connectors won't crash in unforeseen ways.
            lstartseva Lena Startseva added a comment - - edited

            Testing is complete.
            Result of check:

            Connector Version Support "auth_gssapi" Comment
            ODBC 3.1.17-win64 Checked via the Libreoffice
            Connector/J 3.1.0-SNAPSHOT There was a problem with auth_gssapi (in 3.0.8), resoved in 3.1.0-SNAPSHOT
            Connector/C 3.3.2-win64  
            Connector/C++ 1.0.2-win64  
            MySqlConnector for .NET 2.2.0-rc.2 (nuget package)  
            mysql-connector-java 8.0.30 Status : Failure -Test failed: Unable to load authentication plugin 'auth_gssapi_client'
            mysqli 8.1.12(php version) PHP Fatal error: Uncaught mysqli_sql_exception: The server requested authentication method unknown to the client [auth_gssapi_client]
            lstartseva Lena Startseva added a comment - - edited Testing is complete. Result of check: Connector Version Support "auth_gssapi" Comment ODBC 3.1.17-win64 Checked via the Libreoffice Connector/J 3.1.0-SNAPSHOT There was a problem with auth_gssapi (in 3.0.8), resoved in 3.1.0-SNAPSHOT Connector/C 3.3.2-win64   Connector/C++ 1.0.2-win64   MySqlConnector for .NET 2.2.0-rc.2 (nuget package)   mysql-connector-java 8.0.30 Status : Failure -Test failed: Unable to load authentication plugin 'auth_gssapi_client' mysqli 8.1.12(php version) PHP Fatal error: Uncaught mysqli_sql_exception: The server requested authentication method unknown to the client [auth_gssapi_client]

            To clarify, both mysql-connector-java and mysqli will connect fine, as long as password is correct.

            wlad Vladislav Vaintroub added a comment - To clarify, both mysql-connector-java and mysqli will connect fine, as long as password is correct.

            People

              wlad Vladislav Vaintroub
              wlad Vladislav Vaintroub
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.