2 * PowerDNS LDAP Backend
3 * Copyright (C) 2011 Grégory Oestreicher <greg@kamago.net>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2
7 * as published by the Free Software Foundation.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 #include "ldapauthenticator.hh"
21 #ifndef LDAPAUTHENTICATOR_P_HH
22 #define LDAPAUTHENTICATOR_P_HH
24 #ifndef HAVE_KRB5_GET_INIT_CREDS_OPT_SET_DEFAULT_FLAGS
25 #define krb5_get_init_creds_opt_set_default_flags( a, b, c, d ) /* This does not exist with MIT Kerberos */
28 class LdapSimpleAuthenticator
: public LdapAuthenticator
33 std::string lastError
;
35 void fillLastError( LDAP
*conn
, int code
);
38 LdapSimpleAuthenticator( const std::string
&dn
, const std::string
&pw
, int timeout
);
39 virtual bool authenticate( LDAP
*conn
);
40 virtual std::string
getError() const;
43 class LdapGssapiAuthenticator
: public LdapAuthenticator
45 std::string keytabFile
;
46 std::string cCacheFile
;
48 std::string lastError
;
57 int attemptAuth( LDAP
*conn
);
61 LdapGssapiAuthenticator( const std::string
&keytab
, const std::string
&credsCache
, int timeout
);
62 virtual bool authenticate( LDAP
*conn
);
63 virtual std::string
getError() const;
66 #endif // LDAPAUTHENTICATOR_P_HH