1 martin 1.28 //%LICENSE////////////////////////////////////////////////////////////////
|
2 martin 1.29 //
|
3 martin 1.28 // Licensed to The Open Group (TOG) under one or more contributor license
4 // agreements. Refer to the OpenPegasusNOTICE.txt file distributed with
5 // this work for additional information regarding copyright ownership.
6 // Each contributor licenses this file to you under the OpenPegasus Open
7 // Source License; you may not use this file except in compliance with the
8 // License.
|
9 martin 1.29 //
|
10 martin 1.28 // Permission is hereby granted, free of charge, to any person obtaining a
11 // copy of this software and associated documentation files (the "Software"),
12 // to deal in the Software without restriction, including without limitation
13 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
14 // and/or sell copies of the Software, and to permit persons to whom the
15 // Software is furnished to do so, subject to the following conditions:
|
16 martin 1.29 //
|
17 martin 1.28 // The above copyright notice and this permission notice shall be included
18 // in all copies or substantial portions of the Software.
|
19 martin 1.29 //
|
20 martin 1.28 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
21 martin 1.29 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
22 martin 1.28 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
23 // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
24 // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
25 // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
26 // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
27 martin 1.29 //
|
28 martin 1.28 //////////////////////////////////////////////////////////////////////////
|
29 kumpf 1.1 //
30 //%/////////////////////////////////////////////////////////////////////////////
31
32 #ifndef Pegasus_AuthenticationInfoRep_h
33 #define Pegasus_AuthenticationInfoRep_h
34
35 #include <Pegasus/Common/Config.h>
|
36 h.sterling 1.16 #include <Pegasus/Common/ArrayInternal.h>
|
37 kumpf 1.1 #include <Pegasus/Common/String.h>
38 #include <Pegasus/Common/Sharable.h>
|
39 kumpf 1.3 #include <Pegasus/Common/Linkage.h>
|
40 h.sterling 1.10 #include <Pegasus/Common/SSLContext.h>
|
41 marek 1.32 #include <Pegasus/Common/AuthHandle.h>
|
42 kumpf 1.1
|
43 gerarda 1.4 #ifdef PEGASUS_KERBEROS_AUTHENTICATION
|
44 gerarda 1.6 #include <Pegasus/Common/CIMKerberosSecurityAssociation.h>
|
45 gerarda 1.4 #endif
|
46 kumpf 1.1
47 PEGASUS_NAMESPACE_BEGIN
48
49 class AuthenticationInfo;
50
51 /**
|
52 kumpf 1.20 This class keeps the authentication information of a connection
|
53 kumpf 1.1 persistent until the connection is destroyed.
54 */
55 class PEGASUS_COMMON_LINKAGE AuthenticationInfoRep : public Sharable
56 {
57 public:
58
|
59 kumpf 1.20 //ATTN: we should be using an enumeration for the authtype instead of a
60 //string.
61 //In the AuthenticationManager, the authtype is set to Basic, Digest, etc
62 //We also need to be able to check whether the type is SSL, so I'm adding a
63 //string here to make it less arbitrary. PEP165
64 static const String AUTH_TYPE_SSL;
|
65 thilo.boehm 1.27 static const String AUTH_TYPE_ZOS_LOCAL_DOMIAN_SOCKET;
66 static const String AUTH_TYPE_ZOS_ATTLS;
|
67 kumpf 1.20
|
68 marek 1.31 AuthenticationInfoRep();
|
69 kumpf 1.1
70 ~AuthenticationInfoRep();
71
|
72 sushma.fernandes 1.25 void setConnectionAuthenticated(Boolean connectionAuthenticated);
|
73 kumpf 1.1
|
74 kumpf 1.20 String getAuthenticatedUser() const
75 {
|
76 kumpf 1.1 return _authUser;
|
77 kumpf 1.20 }
|
78 kumpf 1.1
79 void setAuthenticatedUser(const String& userName);
80
|
81 thilo.boehm 1.27 #ifdef PEGASUS_OS_ZOS
82
83 // The connection user is for z/OS only.
84 // On z/OS Unix Local Domain Sockets and sockets
85 // protected by AT-TLS are able to get the user ID of
86 // the connected user.
|
87 kumpf 1.30 // This information is needed for later authentication
88 // steps.
|
89 thilo.boehm 1.27
90 String getConnectionUser() const
|
91 marek 1.31 { return _connectionUser;
|
92 thilo.boehm 1.27 }
93
94 void setConnectionUser(const String& userName);
95
96 #endif
97
|
98 kumpf 1.20 String getAuthenticatedPassword() const
99 {
|
100 kumpf 1.7 return _authPassword;
|
101 kumpf 1.20 }
|
102 kumpf 1.7
103 void setAuthenticatedPassword(const String& password);
104
|
105 kumpf 1.26 String getLocalAuthFilePath() const
106 {
107 return _localAuthFilePath;
108 }
109
110 void setLocalAuthFilePath(const String& filePath);
111
|
112 sushma.fernandes 1.24 String getLocalAuthSecret() const
|
113 kumpf 1.20 {
|
114 sushma.fernandes 1.24 return _localAuthSecret;
|
115 kumpf 1.20 }
|
116 kumpf 1.1
|
117 sushma.fernandes 1.24 void setLocalAuthSecret(const String& secret);
|
118 kumpf 1.1
|
119 sushma.fernandes 1.25 Boolean isConnectionAuthenticated() const
|
120 kumpf 1.20 {
|
121 kumpf 1.30 return _connectionAuthenticated;
|
122 kumpf 1.20 }
|
123 kumpf 1.1
|
124 kumpf 1.20 String getAuthType() const
125 {
|
126 kumpf 1.1 return _authType;
|
127 kumpf 1.20 }
|
128 kumpf 1.1
129 void setAuthType(const String& authType);
130
|
131 sushma.fernandes 1.19 void setIpAddress(const String& ipAddress)
132 {
133 _ipAddress = ipAddress;
134 }
135
136 String getIpAddress()
137 {
138 return _ipAddress;
139 }
140
|
141 gerarda 1.4 #ifdef PEGASUS_KERBEROS_AUTHENTICATION
|
142 kumpf 1.20 CIMKerberosSecurityAssociation* getSecurityAssociation() const
143 {
|
144 a.arora 1.9 return _securityAssoc.get();
|
145 gerarda 1.5 }
|
146 sushma.fernandes 1.19
|
147 gerarda 1.5 void setSecurityAssociation();
|
148 gerarda 1.4 #endif
149
|
150 sushma.fernandes 1.18 Array<SSLCertificateInfo*> getClientCertificateChain()
|
151 kumpf 1.11 {
|
152 sushma.fernandes 1.18 return _clientCertificate;
|
153 kumpf 1.11 }
154
|
155 kumpf 1.23 void setClientCertificateChain(
156 Array<SSLCertificateInfo*> clientCertificate);
|
157 h.sterling 1.14
|
158 marek 1.21 void setRemotePrivilegedUserAccessChecked()
159 {
160 _wasRemotePrivilegedUserAccessChecked = true;
161 }
|
162 kumpf 1.22
|
163 marek 1.21 Boolean getRemotePrivilegedUserAccessChecked()
164 {
165 return _wasRemotePrivilegedUserAccessChecked;
166 }
167
|
168 marek 1.32 void setAuthHandle(const AuthHandle& authHandle)
169 {
170 _authHandle = authHandle;
171 }
172
173 AuthHandle getAuthHandle()
174 {
175 return _authHandle;
176 }
177
|
178 marek 1.33 void setUserRole(const String& userRole)
179 {
180 _userRole = userRole;
181 }
182
183 String getUserRole()
184 {
185 return _userRole;
186 }
|
187 marek 1.32
|
188 marek 1.34 void setExpiredPassword(Boolean status)
189 {
190 _isExpiredPassword = status;
191 }
192
193 Boolean isExpiredPassword() const
194 {
195 return _isExpiredPassword;
196 }
197
|
198 kumpf 1.1 private:
199
|
200 marek 1.31 /** Default Copy Constructor and assignment operator */
|
201 kumpf 1.1 AuthenticationInfoRep(const AuthenticationInfoRep& x);
202 AuthenticationInfoRep& operator=(const AuthenticationInfoRep& x);
203
204 String _authUser;
|
205 kumpf 1.7 String _authPassword;
|
206 sushma.fernandes 1.24 String _localAuthSecret;
|
207 kumpf 1.26 String _localAuthFilePath;
|
208 thilo.boehm 1.27 #ifdef PEGASUS_OS_ZOS
209 String _connectionUser;
210 #endif
|
211 kumpf 1.1 String _authType;
|
212 sushma.fernandes 1.25 Boolean _connectionAuthenticated;
|
213 sushma.fernandes 1.19 String _ipAddress;
|
214 gerarda 1.4 #ifdef PEGASUS_KERBEROS_AUTHENTICATION
|
215 a.arora 1.9 AutoPtr<CIMKerberosSecurityAssociation> _securityAssoc;//PEP101
|
216 gerarda 1.4 #endif
|
217 marek 1.21 Boolean _wasRemotePrivilegedUserAccessChecked;
|
218 h.sterling 1.10
|
219 sushma.fernandes 1.18 Array<SSLCertificateInfo*> _clientCertificate;
|
220 marek 1.32
221 AuthHandle _authHandle;
|
222 marek 1.33 String _userRole;
|
223 marek 1.34 Boolean _isExpiredPassword;
|
224 kumpf 1.1 };
225
226 PEGASUS_NAMESPACE_END
227
228 #endif /* Pegasus_AuthenticationInfoRep_h*/
|