1 karl 1.17 //%2006////////////////////////////////////////////////////////////////////////
|
2 kumpf 1.1 //
|
3 karl 1.13 // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
4 // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
5 // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
|
6 karl 1.8 // IBM Corp.; EMC Corporation, The Open Group.
|
7 karl 1.13 // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
8 // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
|
9 karl 1.15 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
10 // EMC Corporation; VERITAS Software Corporation; The Open Group.
|
11 karl 1.17 // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
12 // EMC Corporation; Symantec Corporation; The Open Group.
|
13 kumpf 1.1 //
|
14 kumpf 1.2 // Permission is hereby granted, free of charge, to any person obtaining a copy
15 // of this software and associated documentation files (the "Software"), to
16 // deal in the Software without restriction, including without limitation the
17 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
18 // sell copies of the Software, and to permit persons to whom the Software is
19 // furnished to do so, subject to the following conditions:
20 //
21 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
22 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
23 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
24 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
25 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
26 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
27 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
29 kumpf 1.1 //
30 //==============================================================================
31 //
32 //%/////////////////////////////////////////////////////////////////////////////
33
34 #ifndef Pegasus_AuthenticationInfoRep_h
35 #define Pegasus_AuthenticationInfoRep_h
36
37 #include <Pegasus/Common/Config.h>
|
38 h.sterling 1.16 #include <Pegasus/Common/ArrayInternal.h>
|
39 kumpf 1.1 #include <Pegasus/Common/String.h>
40 #include <Pegasus/Common/Sharable.h>
|
41 kumpf 1.3 #include <Pegasus/Common/Linkage.h>
|
42 h.sterling 1.10 #include <Pegasus/Common/SSLContext.h>
|
43 kumpf 1.1
|
44 gerarda 1.4 #ifdef PEGASUS_KERBEROS_AUTHENTICATION
|
45 gerarda 1.6 #include <Pegasus/Common/CIMKerberosSecurityAssociation.h>
|
46 gerarda 1.4 #endif
|
47 kumpf 1.1
48 PEGASUS_NAMESPACE_BEGIN
49
50 class AuthenticationInfo;
51
52 /**
|
53 kumpf 1.20 This class keeps the authentication information of a connection
|
54 kumpf 1.1 persistent until the connection is destroyed.
55 */
56 class PEGASUS_COMMON_LINKAGE AuthenticationInfoRep : public Sharable
57 {
58 public:
59 enum AuthStatus { NEW_REQUEST, CHALLENGE_SENT, AUTHENTICATED };
60
|
61 kumpf 1.20 //ATTN: we should be using an enumeration for the authtype instead of a
62 //string.
63 //In the AuthenticationManager, the authtype is set to Basic, Digest, etc
64 //We also need to be able to check whether the type is SSL, so I'm adding a
65 //string here to make it less arbitrary. PEP165
66 static const String AUTH_TYPE_SSL;
67
|
68 kumpf 1.1 AuthenticationInfoRep(Boolean flag);
69
70 ~AuthenticationInfoRep();
71
|
72 kumpf 1.20 AuthStatus getAuthStatus() const
73 {
|
74 kumpf 1.1 return _authStatus;
|
75 kumpf 1.20 }
|
76 kumpf 1.1
77 void setAuthStatus(AuthStatus status);
78
|
79 kumpf 1.20 String getAuthenticatedUser() const
80 {
|
81 kumpf 1.1 return _authUser;
|
82 kumpf 1.20 }
|
83 kumpf 1.1
84 void setAuthenticatedUser(const String& userName);
85
|
86 kumpf 1.20 String getAuthenticatedPassword() const
87 {
|
88 kumpf 1.7 return _authPassword;
|
89 kumpf 1.20 }
|
90 kumpf 1.7
91 void setAuthenticatedPassword(const String& password);
92
|
93 sushma.fernandes 1.24 String getLocalAuthSecret() const
|
94 kumpf 1.20 {
|
95 sushma.fernandes 1.24 return _localAuthSecret;
|
96 kumpf 1.20 }
|
97 kumpf 1.1
|
98 sushma.fernandes 1.24 void setLocalAuthSecret(const String& secret);
|
99 kumpf 1.1
|
100 kumpf 1.20 Boolean isAuthenticated() const
101 {
|
102 kumpf 1.1 return (_authStatus == AUTHENTICATED) ? true : false;
|
103 kumpf 1.20 }
|
104 kumpf 1.1
|
105 kumpf 1.20 String getAuthType() const
106 {
|
107 kumpf 1.1 return _authType;
|
108 kumpf 1.20 }
|
109 kumpf 1.1
110 void setAuthType(const String& authType);
111
|
112 sushma.fernandes 1.19 void setIpAddress(const String& ipAddress)
113 {
114 _ipAddress = ipAddress;
115 }
116
117 String getIpAddress()
118 {
119 return _ipAddress;
120 }
121
|
122 gerarda 1.4 #ifdef PEGASUS_KERBEROS_AUTHENTICATION
|
123 kumpf 1.20 CIMKerberosSecurityAssociation* getSecurityAssociation() const
124 {
|
125 a.arora 1.9 return _securityAssoc.get();
|
126 gerarda 1.5 }
|
127 sushma.fernandes 1.19
|
128 gerarda 1.5 void setSecurityAssociation();
|
129 gerarda 1.4 #endif
130
|
131 sushma.fernandes 1.18 Array<SSLCertificateInfo*> getClientCertificateChain()
|
132 kumpf 1.11 {
|
133 sushma.fernandes 1.18 return _clientCertificate;
|
134 kumpf 1.11 }
135
|
136 kumpf 1.23 void setClientCertificateChain(
137 Array<SSLCertificateInfo*> clientCertificate);
|
138 h.sterling 1.14
|
139 marek 1.21 void setRemotePrivilegedUserAccessChecked()
140 {
141 _wasRemotePrivilegedUserAccessChecked = true;
142 }
|
143 kumpf 1.22
|
144 marek 1.21 Boolean getRemotePrivilegedUserAccessChecked()
145 {
146 return _wasRemotePrivilegedUserAccessChecked;
147 }
148
|
149 kumpf 1.1 private:
150
151 /** Constructors */
152 AuthenticationInfoRep();
153
154 AuthenticationInfoRep(const AuthenticationInfoRep& x);
155
156 AuthenticationInfoRep& operator=(const AuthenticationInfoRep& x);
157
158 String _authUser;
|
159 kumpf 1.7 String _authPassword;
|
160 sushma.fernandes 1.24 String _localAuthSecret;
|
161 kumpf 1.1 String _authType;
162 AuthStatus _authStatus;
|
163 sushma.fernandes 1.19 String _ipAddress;
|
164 gerarda 1.4 #ifdef PEGASUS_KERBEROS_AUTHENTICATION
|
165 a.arora 1.9 AutoPtr<CIMKerberosSecurityAssociation> _securityAssoc;//PEP101
|
166 gerarda 1.4 #endif
|
167 marek 1.21 Boolean _wasRemotePrivilegedUserAccessChecked;
|
168 h.sterling 1.10
|
169 sushma.fernandes 1.18 Array<SSLCertificateInfo*> _clientCertificate;
|
170 kumpf 1.1 };
171
172 PEGASUS_NAMESPACE_END
173
174 #endif /* Pegasus_AuthenticationInfoRep_h*/
|