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

Diff for /pegasus/src/Pegasus/Security/Authentication/AuthenticationManager.cpp between version 1.43 and 1.44

version 1.43, 2013/05/28 12:34:24 version 1.44, 2013/06/05 14:09:26
Line 114 
Line 114 
 // //
 // Perform http authentication // Perform http authentication
 // //
 Boolean AuthenticationManager::performHttpAuthentication(  AuthenticationStatus AuthenticationManager::performHttpAuthentication(
     const String& authHeader,     const String& authHeader,
     AuthenticationInfo* authInfo)     AuthenticationInfo* authInfo)
 { {
Line 136 
Line 136 
                 "Malformed HTTP authentication header: %s",                 "Malformed HTTP authentication header: %s",
             (const char*)authHeader.getCString()));             (const char*)authHeader.getCString()));
         PEG_METHOD_EXIT();         PEG_METHOD_EXIT();
         return false;          return AuthenticationStatus(AUTHSC_UNAUTHORIZED);
     }     }
  
     Boolean authenticated = false;      AuthenticationStatus authStatus(AUTHSC_UNAUTHORIZED);
  
     //     //
     // Check the authenticationinformation and do the authentication     // Check the authenticationinformation and do the authentication
Line 147 
Line 147 
     if ( String::equalNoCase(authType, "Basic") &&     if ( String::equalNoCase(authType, "Basic") &&
          String::equal(_httpAuthType, "Basic") )          String::equal(_httpAuthType, "Basic") )
     {     {
         authenticated = _httpAuthHandler->authenticate(cookie, authInfo);          authStatus = _httpAuthHandler->authenticate(cookie, authInfo);
     }     }
 #ifdef PEGASUS_KERBEROS_AUTHENTICATION #ifdef PEGASUS_KERBEROS_AUTHENTICATION
     else if ( String::equalNoCase(authType, "Negotiate") &&     else if ( String::equalNoCase(authType, "Negotiate") &&
               String::equal(_httpAuthType, "Kerberos") )               String::equal(_httpAuthType, "Kerberos") )
     {     {
         authenticated = _httpAuthHandler->authenticate(cookie, authInfo);          authStatus = _httpAuthHandler->authenticate(cookie, authInfo);
     }     }
 #endif #endif
     // FUTURE: Add code to check for "Digest" when digest     // FUTURE: Add code to check for "Digest" when digest
     // authentication is implemented.     // authentication is implemented.
  
     if ( authenticated )      if ( authStatus.isSuccess() )
     {     {
         authInfo->setAuthType(authType);         authInfo->setAuthType(authType);
     }     }
  
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
  
     return authenticated;      return authStatus;
 } }
  
 // //
 // Perform pegasus sepcific local authentication // Perform pegasus sepcific local authentication
 // //
 Boolean AuthenticationManager::performPegasusAuthentication(  AuthenticationStatus AuthenticationManager::performPegasusAuthentication(
     const String& authHeader,     const String& authHeader,
     AuthenticationInfo* authInfo)     AuthenticationInfo* authInfo)
 { {
     PEG_METHOD_ENTER(TRC_AUTHENTICATION,     PEG_METHOD_ENTER(TRC_AUTHENTICATION,
         "AuthenticationManager::performPegasusAuthentication()");         "AuthenticationManager::performPegasusAuthentication()");
  
     Boolean authenticated = false;      AuthenticationStatus authStatus(AUTHSC_UNAUTHORIZED);
  
     String authType;     String authType;
     String userName;     String userName;
Line 198 
Line 198 
                 "Malformed Pegasus authentication header: %s",                 "Malformed Pegasus authentication header: %s",
             (const char*)authHeader.getCString()));             (const char*)authHeader.getCString()));
         PEG_METHOD_EXIT();         PEG_METHOD_EXIT();
         return false;          return AuthenticationStatus(AUTHSC_UNAUTHORIZED);
     }     }
  
     // The HTTPAuthenticatorDelegator ensures only local authentication     // The HTTPAuthenticatorDelegator ensures only local authentication
     // requests get here.     // requests get here.
     PEGASUS_ASSERT(authType == "Local");     PEGASUS_ASSERT(authType == "Local");
  
     authenticated =      authStatus = _localAuthHandler->authenticate(cookie, authInfo);
         _localAuthHandler->authenticate(cookie, authInfo);  
  
     if ( authenticated )      if ( authStatus.isSuccess() )
     {     {
         authInfo->setAuthType(authType);         authInfo->setAuthType(authType);
     }     }
  
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
  
     return authenticated;      return authStatus;
 } }
  
 // //
 // Validate user. // Validate user.
 // //
 Boolean AuthenticationManager::validateUserForHttpAuth(  AuthenticationStatus AuthenticationManager::validateUserForHttpAuth(
     const String& userName,     const String& userName,
     AuthenticationInfo* authInfo)     AuthenticationInfo* authInfo)
 { {


Legend:
Removed from v.1.43  
changed lines
  Added in v.1.44

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2