MySQL 8.0.39
Source Code Documentation
sspi_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_SSAPI_CLIENT_H_
25#define AUTH_SSAPI_CLIENT_H_
26
27#include <stdio.h>
28#include <stdlib.h>
29
30/*
31 This symbol should be used when accessing the security API from a user-mode
32 application
33*/
34#define SECURITY_WIN32
35
36/*
37 Note: Added below header files with one extra lines.
38 Automatically code formatting changes the order of header file.
39 We need to maintain the order of header file, otherwise build will fail.
40*/
41
42#include <windows.h>
43
44#include <sspi.h>
45
46#include <SecExt.h>
47
48#include <stdarg.h>
49
51
53 public:
54 Sspi_client(const std::string &spn, MYSQL_PLUGIN_VIO *vio,
55 const std::string &upn, const std::string &password,
56 const std::string &kdc_host);
57 ~Sspi_client() override = default;
58 bool authenticate() override;
59 bool obtain_store_credentials() override;
60 std::string get_user_name() override;
61
62 protected:
64 /* Plug-in VIO. */
66 std::string m_upn;
67 std::string m_password;
68 std::string m_kdc_host;
69 CredHandle m_cred;
70};
71#endif // AUTH_SSAPI_CLIENT_H_
Definition: kerberos_client_interface.h:31
Definition: sspi_authentication_client.h:52
std::string m_password
Definition: sspi_authentication_client.h:67
MYSQL_PLUGIN_VIO * m_vio
Definition: sspi_authentication_client.h:65
std::string get_user_name() override
Definition: sspi_authentication_client.cc:110
std::string m_service_principal
Definition: sspi_authentication_client.h:63
std::string m_upn
Definition: sspi_authentication_client.h:66
~Sspi_client() override=default
bool authenticate() override
Definition: sspi_authentication_client.cc:123
bool obtain_store_credentials() override
Definition: sspi_authentication_client.cc:49
CredHandle m_cred
Definition: sspi_authentication_client.h:69
Sspi_client(const std::string &spn, MYSQL_PLUGIN_VIO *vio, const std::string &upn, const std::string &password, const std::string &kdc_host)
Definition: sspi_authentication_client.cc:40
std::string m_kdc_host
Definition: sspi_authentication_client.h:68
static char * password
Definition: mysql_secure_installation.cc:56
Provides plugin access to communication channel.
Definition: plugin_auth_common.h:146