876d079ad3005d9c9fb65d6459d98cdbd778f26c
[mono.git] / mcs / class / Novell.Directory.Ldap / Novell.Directory.Ldap / LdapAuthProvider.cs
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:
11
12 * The above copyright notice and this permission notice shall be included in 
13 * all copies or substantial portions of the Software.
14
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 *******************************************************************************/
23 //
24 // Novell.Directory.Ldap.LdapAuthProvider.cs
25 //
26 // Author:
27 //   Sunil Kumar (Sunilk@novell.com)
28 //
29 // (C) 2003 Novell, Inc (http://www.novell.com)
30 //
31
32 using System;
33 namespace Novell.Directory.Ldap
34 {
35         
36         /// <summary>  An implementation of LdapAuthHandler must be able to provide an
37         /// LdapAuthProvider object at the time of a referral.  The class
38         /// encapsulates information that is used by the client for authentication
39         /// when following referrals automatically.
40         /// 
41         /// </summary>
42         /// <seealso cref="LdapAuthHandler">
43         /// </seealso>
44         /// <seealso cref="LdapBindHandler">
45         /// </seealso>
46         public class LdapAuthProvider
47         {
48                 /// <summary> Returns the distinguished name to be used for authentication on
49                 /// automatic referral following.
50                 /// 
51                 /// </summary>
52                 /// <returns> The distinguished name from the object.
53                 /// </returns>
54                 virtual public System.String DN
55                 {
56                         get
57                         {
58                                 return dn;
59                         }
60                         
61                 }
62                 /// <summary> Returns the password to be used for authentication on automatic
63                 /// referral following.
64                 /// 
65                 /// </summary>
66                 /// <returns> The byte[] value (UTF-8) of the password from the object.
67                 /// </returns>
68                 [CLSCompliantAttribute(false)]
69                 virtual public sbyte[] Password
70                 {
71                         get
72                         {
73                                 return password;
74                         }
75                         
76                 }
77                 
78                 private System.String dn;
79                 private sbyte[] password;
80                 
81                 /// <summary> Constructs information that is used by the client for authentication
82                 /// when following referrals automatically.
83                 /// 
84                 /// </summary>
85                 /// <param name="dn">          The distinguished name to use when authenticating to
86                 /// a server.
87                 /// 
88                 /// </param>
89                 /// <param name="password">    The password to use when authenticating to a server.
90                 /// </param>
91                 [CLSCompliantAttribute(false)]
92                 public LdapAuthProvider(System.String dn, sbyte[] password)
93                 {
94                         this.dn = dn;
95                         this.password = password;
96                         return ;
97                 }
98         }
99 }