version 1.1, 2013/05/28 12:36:51
|
version 1.2, 2013/06/05 14:09:26
|
|
|
#include <Pegasus/Common/Tracer.h> | #include <Pegasus/Common/Tracer.h> |
#include "PAMSessionBasicAuthenticator.h" | #include "PAMSessionBasicAuthenticator.h" |
#include "PAMSession.h" | #include "PAMSession.h" |
|
#include "pam_rcToAuthStatus.h" |
| |
PEGASUS_USING_STD; | PEGASUS_USING_STD; |
| |
|
|
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
} | } |
| |
Boolean PAMSessionBasicAuthenticator::authenticate( |
AuthenticationStatus PAMSessionBasicAuthenticator::authenticate( |
const String& userName, | const String& userName, |
const String& password, | const String& password, |
AuthenticationInfo* authInfo) | AuthenticationInfo* authInfo) |
|
|
PEG_METHOD_ENTER(TRC_AUTHENTICATION, | PEG_METHOD_ENTER(TRC_AUTHENTICATION, |
"PAMSessionBasicAuthenticator::authenticate()"); | "PAMSessionBasicAuthenticator::authenticate()"); |
| |
if (PAM_SUCCESS != _PAMAuthenticate( |
int pamRC = _PAMAuthenticate( |
userName.getCString(), | userName.getCString(), |
password.getCString(), | password.getCString(), |
authInfo)) |
authInfo); |
{ |
|
PEG_METHOD_EXIT(); |
AuthenticationStatus authStatus = _getAuthStatusFromPAM_RC(pamRC); |
return false; |
|
} |
|
| |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
return true; |
return authStatus; |
} | } |
| |
Boolean PAMSessionBasicAuthenticator::validateUser( |
AuthenticationStatus PAMSessionBasicAuthenticator::validateUser( |
const String& userName, | const String& userName, |
AuthenticationInfo* authInfo) | AuthenticationInfo* authInfo) |
{ | { |
PEG_METHOD_ENTER(TRC_AUTHENTICATION, | PEG_METHOD_ENTER(TRC_AUTHENTICATION, |
"PAMSessionBasicAuthenticator::validateUser()"); | "PAMSessionBasicAuthenticator::validateUser()"); |
| |
if (PAM_SUCCESS != _PAMValidateUser( |
int pamRC = _PAMValidateUser(userName.getCString(), authInfo); |
userName.getCString(), |
AuthenticationStatus authStatus = _getAuthStatusFromPAM_RC(pamRC); |
authInfo)) |
|
{ |
|
PEG_METHOD_EXIT(); |
|
return false; |
|
} |
|
| |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
return true; |
return authStatus; |
} | } |
| |
| |