(file) Return to AuthenticationManager.h CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Security / Authentication

  1 karl  1.12 //%2006////////////////////////////////////////////////////////////////////////
  2 mike  1.2  //
  3 karl  1.9  // 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.9  // 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.10 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
 10            // EMC Corporation; VERITAS Software Corporation; The Open Group.
 11 karl  1.12 // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
 12            // EMC Corporation; Symantec Corporation; The Open Group.
 13 mike  1.2  //
 14 kumpf 1.5  // 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 mike  1.2  //
 30            //==============================================================================
 31            //
 32            //%/////////////////////////////////////////////////////////////////////////////
 33            
 34            #ifndef Pegasus_AuthenticationManager_h
 35            #define Pegasus_AuthenticationManager_h
 36            
 37            #include <Pegasus/Common/Config.h>
 38 kumpf 1.4  
 39            #include "Authenticator.h"
 40 mike  1.2  
 41 chuck 1.6  #include <Pegasus/Security/Authentication/Linkage.h>
 42 mike  1.2  
 43 gerarda 1.7  #ifdef PEGASUS_KERBEROS_AUTHENTICATION
 44              #include <Pegasus/Common/AuthenticationInfo.h>
 45              #endif
 46              
 47 mike    1.2  PEGASUS_NAMESPACE_BEGIN
 48              
 49 kumpf   1.4  /** This class implements the HTTP authentication and Pegasus Local 
 50                  authentication mecahnism. It provides methods to perform authentication
 51                  and to generate authentication challenge headers.
 52 mike    1.2  */
 53              
 54              class PEGASUS_SECURITY_LINKAGE AuthenticationManager
 55              {
 56              public:
 57              
 58 kumpf   1.4      /**Constructor */
 59 mike    1.2      AuthenticationManager();
 60              
 61 kumpf   1.4      /**Destructor */
 62 mike    1.2      ~AuthenticationManager();
 63              
 64 kumpf   1.4      /** Authenticates the requests from HTTP connections.
 65                      @param authHeader String containing the Authorization header
 66                      @param authInfo Reference to AuthenticationInfo object that holds the
 67                      authentication information for the given connection.
 68                      @return true on successful authentication, false otherwise
 69                  */
 70 mike    1.2      Boolean performHttpAuthentication(
 71 kumpf   1.3          const String& authHeader,
 72 mike    1.2          AuthenticationInfo* authInfo);
 73              
 74 kumpf   1.4      /** Authenticates the requests from Local connections.
 75                      @param authHeader String containing the Authorization header
 76                      @param authInfo Reference to AuthenticationInfo object that holds the
 77                      authentication information for the given connection.
 78                      @return true on successful authentication, false otherwise
 79                  */
 80 mike    1.2      Boolean performPegasusAuthentication(
 81 kumpf   1.3          const String& authHeader,
 82 mike    1.2          AuthenticationInfo* authInfo);
 83              
 84 sushma.fernandes 1.11     /** Validates whether the user is a valid user for requests
 85                               from HTTP connections.
 86                               @param  userName  name of the user
 87                               @return true on successful validation, false otherwise
 88                           */
 89                           Boolean validateUserForHttpAuth (const String& userName);
 90                       
 91 kumpf            1.4      /** Constructs the Pegasus Local authentication challenge header.
 92                               @param authHeader String containing the Authorization header
 93                               @param authInfo reference to AuthenticationInfo object that holds the
 94                               authentication information for the given connection.
 95                               @return String containing the authentication challenge
 96                           */
 97 mike             1.2      String getPegasusAuthResponseHeader(
 98 kumpf            1.3          const String& authHeader,
 99 mike             1.2          AuthenticationInfo* authInfo);
100                       
101 kumpf            1.4      /** Constructs the HTTP authentication challenge header.
102                               @return String containing the authentication challenge
103                           */
104 gerarda          1.7  #ifdef PEGASUS_KERBEROS_AUTHENTICATION
105                           String AuthenticationManager::getHttpAuthResponseHeader(
106                       	AuthenticationInfo* authInfo = 0);
107                       #else
108 mike             1.2      String getHttpAuthResponseHeader();
109 gerarda          1.7  #endif
110 sushma.fernandes 1.11 
111 marek            1.13     static Boolean isRemotePrivilegedUserAccessAllowed(
112                               String & userName);
113                       
114 mike             1.2  private:
115                       
116 kumpf            1.4      Boolean _parseLocalAuthHeader(
117 kumpf            1.3          const String& authHeader, 
118                               String& authType, 
119                               String& userName, 
120                               String& cookie);
121 mike             1.2  
122 kumpf            1.4      Boolean _parseHttpAuthHeader(
123                               const String& authHeader, 
124                               String& authType, 
125                               String& cookie);
126 mike             1.2  
127                           Authenticator* _getLocalAuthHandler();
128                       
129                           Authenticator* _getHttpAuthHandler();
130 kumpf            1.4  
131                           Authenticator* _localAuthHandler;
132                           Authenticator* _httpAuthHandler;
133                           String         _httpAuthType;
134 mike             1.2  
135                       };
136                       
137                       PEGASUS_NAMESPACE_END
138                       
139                       #endif /* Pegasus_AuthenticationManager_h */
140                       

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2