MySQL 8.0.40
Source Code Documentation
gssapi_authentication_client.h
Go to the documentation of this file.
1/* Copyright (c) 2021, 2024, Oracle and/or its affiliates.
2
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License, version 2.0,
5 as published by the Free Software Foundation.
6
7 This program is designed to work with certain software (including
8 but not limited to OpenSSL) that is licensed under separate terms,
9 as designated in a particular file or component or in included license
10 documentation. The authors of MySQL hereby grant you an additional
11 permission to link the program and your derivative works with the
12 separately licensed software that they have either included with
13 the program or referenced in the documentation.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License, version 2.0, for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23
24#ifndef AUTH_GSSAPI_CLIENT_H_
25#define AUTH_GSSAPI_CLIENT_H_
26
27#include <gssapi/gssapi.h>
28#include <memory>
29
30#include "kerberos_core.h"
31#include "log_client.h"
32
34
36 public:
37 Gssapi_client(const std::string &spn, MYSQL_PLUGIN_VIO *vio,
38 const std::string &upn, const std::string &password);
39 ~Gssapi_client() override;
40 bool authenticate() override;
41 std::string get_user_name() override;
42 void set_upn_info(const std::string &name, const std::string &pwd);
43 bool obtain_store_credentials() override;
44
45 protected:
47 /* Plug-in VIO. */
50 std::string m_password;
51 std::unique_ptr<auth_kerberos_context::Kerberos> m_kerberos{nullptr};
52};
53#endif // AUTH_GSSAPI_CLIENT_H_
Definition: gssapi_authentication_client.h:35
void set_upn_info(const std::string &name, const std::string &pwd)
Definition: gssapi_authentication_client.cc:120
std::unique_ptr< auth_kerberos_context::Kerberos > m_kerberos
Definition: gssapi_authentication_client.h:51
MYSQL_PLUGIN_VIO * m_vio
Definition: gssapi_authentication_client.h:48
std::string m_user_principal_name
Definition: gssapi_authentication_client.h:49
bool authenticate() override
Definition: gssapi_authentication_client.cc:50
std::string m_service_principal
Definition: gssapi_authentication_client.h:46
std::string get_user_name() override
Definition: gssapi_authentication_client.cc:140
bool obtain_store_credentials() override
Definition: gssapi_authentication_client.cc:135
std::string m_password
Definition: gssapi_authentication_client.h:50
Gssapi_client(const std::string &spn, MYSQL_PLUGIN_VIO *vio, const std::string &upn, const std::string &password)
Definition: gssapi_authentication_client.cc:36
~Gssapi_client() override
Definition: gssapi_authentication_client.cc:48
Definition: kerberos_client_interface.h:31
static char * password
Definition: mysql_secure_installation.cc:56
case opt name
Definition: sslopt-case.h:33
Provides plugin access to communication channel.
Definition: plugin_auth_common.h:146