version 1.32, 2007/08/22 07:43:38
|
version 1.32.2.1, 2007/09/12 23:56:25
|
|
|
| |
#include <Pegasus/Config/ConfigManager.h> | #include <Pegasus/Config/ConfigManager.h> |
| |
|
#ifdef PEGASUS_ENABLE_LOCAL_AUTHENTICATION |
#include "LocalAuthenticationHandler.h" | #include "LocalAuthenticationHandler.h" |
|
#endif |
|
|
#include "BasicAuthenticationHandler.h" | #include "BasicAuthenticationHandler.h" |
#include "AuthenticationManager.h" | #include "AuthenticationManager.h" |
| |
|
|
// | // |
// get authentication handlers | // get authentication handlers |
// | // |
|
#ifdef PEGASUS_ENABLE_LOCAL_AUTHENTICATION |
_localAuthHandler = _getLocalAuthHandler(); | _localAuthHandler = _getLocalAuthHandler(); |
|
#endif |
| |
_httpAuthHandler = _getHttpAuthHandler(); | _httpAuthHandler = _getHttpAuthHandler(); |
| |
|
|
// | // |
// delete authentication handlers | // delete authentication handlers |
// | // |
|
#ifdef PEGASUS_ENABLE_LOCAL_AUTHENTICATION |
delete _localAuthHandler; | delete _localAuthHandler; |
|
#endif |
delete _httpAuthHandler; | delete _httpAuthHandler; |
| |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
|
|
return authenticated; | return authenticated; |
} | } |
| |
|
#ifdef PEGASUS_ENABLE_LOCAL_AUTHENTICATION |
|
|
// | // |
// Perform pegasus sepcific local authentication | // Perform pegasus sepcific local authentication |
// | // |
|
|
// requests get here. | // requests get here. |
PEGASUS_ASSERT(authType == "Local"); | PEGASUS_ASSERT(authType == "Local"); |
| |
authenticated = |
authenticated = _localAuthHandler->authenticate(cookie, authInfo); |
_localAuthHandler->authenticate(cookie, authInfo); |
|
| |
if ( authenticated ) | if ( authenticated ) |
{ | { |
|
|
return authenticated; | return authenticated; |
} | } |
| |
|
#endif /* PEGASUS_ENABLE_LOCAL_AUTHENTICATION */ |
|
|
// | // |
// Validate user. | // Validate user. |
// | // |
|
|
return _httpAuthHandler->validateUser(userName); | return _httpAuthHandler->validateUser(userName); |
} | } |
| |
|
#ifdef PEGASUS_ENABLE_LOCAL_AUTHENTICATION |
|
|
// | // |
// Get pegasus/local authentication response header | // Get pegasus/local authentication response header |
// | // |
|
|
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
| |
return respHeader; | return respHeader; |
|
|
} | } |
| |
|
#endif /* PEGASUS_ENABLE_LOCAL_AUTHENTICATION */ |
|
|
// | // |
// Get HTTP authentication response header | // Get HTTP authentication response header |
// | // |
|
|
return respHeader; | return respHeader; |
} | } |
| |
|
#ifdef PEGASUS_ENABLE_LOCAL_AUTHENTICATION |
|
|
// | // |
// Get local authentication handler | // Get local authentication handler |
// | // |
|
|
return new LocalAuthenticationHandler(); | return new LocalAuthenticationHandler(); |
} | } |
| |
|
#endif /* PEGASUS_ENABLE_LOCAL_AUTHENTICATION */ |
|
|
| |
// | // |
// Get Http authentication handler | // Get Http authentication handler |