**** Merged from MCS ****
[mono-project.git] / mcs / class / Novell.Directory.Ldap / Novell.Directory.Ldap / LdapBindHandler.cs
blob2552f1fdd15eb579641198d97ef270f61ecd8164
1 /******************************************************************************
2 * The MIT License
3 * Copyright (c) 2003 Novell Inc. www.novell.com
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a copy
6 * of this software and associated documentation files (the Software), to deal
7 * in the Software without restriction, including without limitation the rights
8 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 * copies of the Software, and to permit persons to whom the Software is
10 * furnished to do so, subject to the following conditions:
12 * The above copyright notice and this permission notice shall be included in
13 * all copies or substantial portions of the Software.
15 * THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 * SOFTWARE.
22 *******************************************************************************/
24 // Novell.Directory.Ldap.LdapBindHandler.cs
26 // Author:
27 // Sunil Kumar (Sunilk@novell.com)
29 // (C) 2003 Novell, Inc (http://www.novell.com)
32 using System;
33 namespace Novell.Directory.Ldap
36 /// <summary>
37 /// Used to do explicit bind processing on a referral.
38 ///
39 /// This interface allows a programmer to override the default
40 /// authentication and reauthentication behavior when automatically
41 /// following referrals and search references. It is used to control the
42 /// authentication mechanism used on automatic referral following.
43 ///
44 /// A client can specify an instance of this class to be used
45 /// on a single operation (through the LdapConstraints object)
46 /// or for all operations (through the LdapContraints object
47 /// associated with the connection).
48 ///
49 ///
50 /// </summary>
51 /// <seealso cref="LdapAuthHandler">
52 /// </seealso>
53 /// <seealso cref="LdapConstraints.ReferralFollowing">
54 /// </seealso>
55 public interface LdapBindHandler : LdapReferralHandler
58 /// <summary> Called by LdapConnection when a referral is received.
59 ///
60 /// This method has the responsibility to bind to one of the
61 /// hosts in the list specified by the ldaprul parameter which corresponds
62 /// exactly to the list of hosts returned in a single referral response.
63 /// An implementation may access the host, port, credentials, and other
64 /// information in the original LdapConnection object to decide on an
65 /// appropriate authentication mechanism, and/or interact with a user or
66 /// external module. The object implementing LdapBind creates a new
67 /// LdapConnection object to perform its connect and bind calls. It
68 /// returns the new connection when both the connect and bind operations
69 /// succeed on one host from the list. The LdapConnection object referral
70 /// following code uses the new LdapConnection object when it resends the
71 /// search request, updated with the new search base and possible search
72 /// filter. An LdapException is thrown on failure, as in the
73 /// LdapConnection.bind method.
74 ///
75 /// </summary>
76 /// <param name="ldapurl">The list of servers contained in a referral response.
77 /// </param>
78 /// <param name="conn"> An established connection to an Ldap server.
79 ///
80 /// </param>
81 /// <returns> An established connection to one of the ldap servers
82 /// in the referral list.
83 ///
84 /// </returns>
85 /// <exception> LdapReferralException An LdapreferralException is thrown
86 /// with appropriate fields set to give the reason for the failure.
87 /// </exception>
88 LdapConnection Bind(System.String[] ldapurl, LdapConnection conn);