(file) Return to AuthenticationInfoRep.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common

  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             #include <Pegasus/Common/Config.h>
 33             #include <Pegasus/Common/Tracer.h>
 34             #include "AuthenticationInfoRep.h"
 35 h.sterling 1.10 #include <Pegasus/Common/SSLContext.h>
 36 sahana.prabhakar 1.31 #include <Pegasus/Common/FileSystem.h>
 37                       #include <Pegasus/Common/Executor.h>
 38 kumpf            1.1  
 39                       PEGASUS_USING_STD;
 40                       
 41                       PEGASUS_NAMESPACE_BEGIN
 42                       
 43 h.sterling       1.12 const String AuthenticationInfoRep::AUTH_TYPE_SSL = "SSL";
 44 thilo.boehm      1.27 const String AuthenticationInfoRep::AUTH_TYPE_ZOS_LOCAL_DOMIAN_SOCKET = "LDS";
 45                       const String AuthenticationInfoRep::AUTH_TYPE_ZOS_ATTLS = "ATTLS";
 46 kumpf            1.1  
 47 marek            1.32 AuthenticationInfoRep::AuthenticationInfoRep()
 48 kumpf            1.25     : _connectionAuthenticated(false),
 49 marek            1.33       _wasRemotePrivilegedUserAccessChecked(false),
 50 marek            1.34       _authHandle(),
 51                             _isExpiredPassword(false)
 52 kumpf            1.19 {
 53 kumpf            1.1      PEG_METHOD_ENTER(
 54                               TRC_AUTHENTICATION, "AuthenticationInfoRep::AuthenticationInfoRep");
 55                       
 56                           PEG_METHOD_EXIT();
 57                       }
 58                       
 59                       AuthenticationInfoRep::~AuthenticationInfoRep()
 60                       {
 61                           PEG_METHOD_ENTER(
 62                               TRC_AUTHENTICATION, "AuthenticationInfoRep::~AuthenticationInfoRep");
 63 gerarda          1.4  
 64 sahana.prabhakar 1.31     // initiate the deletion of _localAuthFilePath.
 65                           if(FileSystem::exists(_localAuthFilePath))
 66                           {
 67                               // No response was received from the local client for the 
 68                               // authentication challenge. Hence deleting the file here.
 69                       
 70                               // Use executor, if present.
 71                               if (Executor::detectExecutor() == 0)
 72                               {
 73                                   Executor::removeFile(_localAuthFilePath.getCString());
 74                               }
 75                               else
 76                               {
 77                                   FileSystem::removeFile(_localAuthFilePath);
 78                               }
 79                           }
 80                              
 81 kumpf            1.1      PEG_METHOD_EXIT();
 82                       }
 83                       
 84 kumpf            1.24 void AuthenticationInfoRep::setConnectionAuthenticated(
 85 sushma.fernandes 1.23     Boolean connectionAuthenticated)
 86 kumpf            1.1  {
 87 kumpf            1.24     PEG_METHOD_ENTER(TRC_AUTHENTICATION,
 88                               "AuthenticationInfoRep::setConnectionAuthenticated");
 89 kumpf            1.1  
 90 sushma.fernandes 1.23     _connectionAuthenticated = connectionAuthenticated;
 91 kumpf            1.1  
 92                           PEG_METHOD_EXIT();
 93                       }
 94                       
 95 thilo.boehm      1.27 #ifdef PEGASUS_OS_ZOS
 96                       
 97                           // The connection user is for z/OS only.
 98                           // On z/OS Unix Local Domain Sockets and sockets
 99                           // protected by AT-TLS are able to get the user ID of
100                           // the connected user.
101 kumpf            1.30     // This information is needed for later authentication
102                           // steps.
103 thilo.boehm      1.27 
104                       void AuthenticationInfoRep::setConnectionUser(const String& userName)
105                       {
106                           PEG_METHOD_ENTER(
107                               TRC_AUTHENTICATION, "AuthenticationInfoRep::setConnectionUser()");
108                       
109                           _connectionUser = userName;
110                       
111                           PEG_METHOD_EXIT();
112                       }
113                       #endif
114                       
115 kumpf            1.24 void AuthenticationInfoRep::setAuthenticatedUser(const String& userName)
116 kumpf            1.1  {
117                           PEG_METHOD_ENTER(
118                               TRC_AUTHENTICATION, "AuthenticationInfoRep::setAuthenticatedUser");
119                       
120                           _authUser = userName;
121 kumpf            1.6  
122                           PEG_METHOD_EXIT();
123                       }
124                       
125 kumpf            1.24 void AuthenticationInfoRep::setAuthenticatedPassword(const String& password)
126 kumpf            1.6  {
127                           PEG_METHOD_ENTER(
128                               TRC_AUTHENTICATION, "AuthenticationInfoRep::setAuthenticatedPassword");
129                       
130                           _authPassword = password;
131 kumpf            1.1  
132                           PEG_METHOD_EXIT();
133                       }
134                       
135 kumpf            1.26 void AuthenticationInfoRep::setLocalAuthFilePath(const String& filePath)
136                       {
137                           PEG_METHOD_ENTER(
138                               TRC_AUTHENTICATION, "AuthenticationInfoRep::setLocalAuthFilePath");
139                       
140                           _localAuthFilePath = filePath;
141                       
142                           PEG_METHOD_EXIT();
143                       }
144                       
145 kumpf            1.24 void AuthenticationInfoRep::setLocalAuthSecret(const String& secret)
146 kumpf            1.1  {
147                           PEG_METHOD_ENTER(
148 sushma.fernandes 1.22         TRC_AUTHENTICATION, "AuthenticationInfoRep::setLocalAuthSecret");
149 kumpf            1.1  
150 sushma.fernandes 1.22     _localAuthSecret = secret;
151 kumpf            1.1  
152                           PEG_METHOD_EXIT();
153                       }
154                       
155 kumpf            1.24 void AuthenticationInfoRep::setAuthType(const String& authType)
156 kumpf            1.1  {
157                           PEG_METHOD_ENTER(
158                               TRC_AUTHENTICATION, "AuthenticationInfoRep::setAuthType");
159                       
160                           _authType = authType;
161                       
162                           PEG_METHOD_EXIT();
163                       }
164 gerarda          1.5  
165                       #ifdef PEGASUS_KERBEROS_AUTHENTICATION
166 kumpf            1.24 void AuthenticationInfoRep::setSecurityAssociation()
167 gerarda          1.5  {
168                           PEG_METHOD_ENTER(
169                               TRC_AUTHENTICATION, "AuthenticationInfoRep::setSecurityAssociation");
170                       
171 a.arora          1.8      if ( !_securityAssoc.get() )
172 gerarda          1.5      {
173 a.arora          1.9          _securityAssoc.reset(new CIMKerberosSecurityAssociation);
174 gerarda          1.5      }
175                       
176                           PEG_METHOD_EXIT();
177                       }
178                       #endif
179                       
180 kumpf            1.19 void AuthenticationInfoRep::setClientCertificateChain(
181                           Array<SSLCertificateInfo*> clientCertificate)
182 h.sterling       1.14 {
183                           PEG_METHOD_ENTER(TRC_AUTHENTICATION,
184 h.sterling       1.16         "AuthenticationInfoRep::setClientCertificateChain");
185 h.sterling       1.14 
186                           _clientCertificate = clientCertificate;
187                       
188                           PEG_METHOD_EXIT();
189                       }
190                       
191 kumpf            1.1  PEGASUS_NAMESPACE_END

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2