apr_ldap_rebind.h revision 302408
1/* Licensed to the Apache Software Foundation (ASF) under one or more
2 * contributor license agreements.  See the NOTICE file distributed with
3 * this work for additional information regarding copyright ownership.
4 * The ASF licenses this file to You under the Apache License, Version 2.0
5 * (the "License"); you may not use this file except in compliance with
6 * the License.  You may obtain a copy of the License at
7 *
8 *     http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17/**
18 * The APR LDAP rebind functions provide an implementation of
19 * a rebind procedure that can be used to allow clients to chase referrals,
20 * using the same credentials used to log in originally.
21 *
22 * Use of this implementation is optional.
23 *
24 * @file apr_ldap_rebind.h
25 * @brief Apache LDAP library
26 */
27
28#ifndef APU_LDAP_REBIND_H
29#define APU_LDAP_REBIND_H
30
31/**
32 * @addtogroup APR_Util_LDAP
33 * @{
34 **/
35
36#if defined(DOXYGEN)
37#include "apr_ldap.h"
38#endif
39
40/*
41 * Handle the case when LDAP is enabled
42 */
43#if APR_HAS_LDAP
44
45/**
46 * APR LDAP initialize rebind lock
47 *
48 * This function creates the lock for controlling access to the xref list..
49 * @param pool Pool to use when creating the xref_lock.
50 */
51APU_DECLARE_LDAP(apr_status_t) apr_ldap_rebind_init(apr_pool_t *pool);
52
53
54/**
55 * APR LDAP rebind_add function
56 *
57 * This function creates a cross reference entry for the specified ldap
58 * connection. The rebind callback function will look up this ldap
59 * connection so it can retrieve the bindDN and bindPW for use in any
60 * binds while referrals are being chased.
61 *
62 * This function will add the callback to the LDAP handle passed in.
63 *
64 * A cleanup is registered within the pool provided to remove this
65 * entry when the pool is removed. Alternatively apr_ldap_rebind_remove()
66 * can be called to explicitly remove the entry at will.
67 *
68 * @param pool The pool to use
69 * @param ld The LDAP connectionhandle
70 * @param bindDN The bind DN to be used for any binds while chasing
71 *               referrals on this ldap connection.
72 * @param bindPW The bind Password to be used for any binds while
73 *               chasing referrals on this ldap connection.
74 */
75APU_DECLARE_LDAP(apr_status_t) apr_ldap_rebind_add(apr_pool_t *pool,
76                                                   LDAP *ld,
77                                                   const char *bindDN,
78                                                   const char *bindPW);
79
80/**
81 * APR LDAP rebind_remove function
82 *
83 * This function removes the rebind cross reference entry for the
84 * specified ldap connection.
85 *
86 * If not explicitly removed, this function will be called automatically
87 * when the pool is cleaned up.
88 *
89 * @param ld The LDAP connectionhandle
90 */
91APU_DECLARE_LDAP(apr_status_t) apr_ldap_rebind_remove(LDAP *ld);
92
93#endif /* APR_HAS_LDAP */
94
95/** @} */
96
97#endif /* APU_LDAP_REBIND_H */
98
99