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

Diff for /pegasus/src/Pegasus/Security/Authentication/LocalAuthenticationHandler.cpp between version 1.3 and 1.5

version 1.3, 2002/01/24 19:10:32 version 1.5, 2002/03/21 22:11:15
Line 31 
Line 31 
  
 #include <Pegasus/Common/Logger.h> #include <Pegasus/Common/Logger.h>
 #include <Pegasus/Common/Tracer.h> #include <Pegasus/Common/Tracer.h>
 #include <Pegasus/Security/Authentication/SecureLocalAuthenticator.h>  
   #include "SecureLocalAuthenticator.h"
 #include "LocalAuthenticationHandler.h" #include "LocalAuthenticationHandler.h"
  
   
 PEGASUS_USING_STD; PEGASUS_USING_STD;
  
 PEGASUS_NAMESPACE_BEGIN PEGASUS_NAMESPACE_BEGIN
Line 41 
Line 43 
  
 LocalAuthenticationHandler::LocalAuthenticationHandler() LocalAuthenticationHandler::LocalAuthenticationHandler()
 { {
     const char METHOD_NAME[] =      PEG_METHOD_ENTER(TRC_AUTHENTICATION,
         "LocalAuthenticationHandler::LocalAuthenticationHandler()";         "LocalAuthenticationHandler::LocalAuthenticationHandler()");
   
     PEG_FUNC_ENTER(TRC_AUTHENTICATION, METHOD_NAME);  
   
     // ATTN: Load the local authentication module here  
  
     _localAuthenticator = (LocalAuthenticator*) new SecureLocalAuthenticator();     _localAuthenticator = (LocalAuthenticator*) new SecureLocalAuthenticator();
  
     PEG_FUNC_EXIT(TRC_AUTHENTICATION, METHOD_NAME);      PEG_METHOD_EXIT();
 } }
  
 LocalAuthenticationHandler::~LocalAuthenticationHandler() LocalAuthenticationHandler::~LocalAuthenticationHandler()
 { {
     const char METHOD_NAME[] =      PEG_METHOD_ENTER(TRC_AUTHENTICATION,
         "LocalAuthenticationHandler::~LocalAuthenticationHandler()";          "LocalAuthenticationHandler::~LocalAuthenticationHandler()");
   
     PEG_FUNC_ENTER(TRC_AUTHENTICATION, METHOD_NAME);  
   
     PEG_FUNC_EXIT(TRC_AUTHENTICATION, METHOD_NAME);  
  
     delete _localAuthenticator;     delete _localAuthenticator;
   
       PEG_METHOD_EXIT();
 } }
  
 Boolean LocalAuthenticationHandler::authenticate( Boolean LocalAuthenticationHandler::authenticate(
     const String& authHeader,     const String& authHeader,
     AuthenticationInfo* authInfo)     AuthenticationInfo* authInfo)
 { {
     const char METHOD_NAME[] =      PEG_METHOD_ENTER(TRC_AUTHENTICATION,
         "LocalAuthenticationHandler::authenticate()";          "LocalAuthenticationHandler::authenticate()");
   
     PEG_FUNC_ENTER(TRC_AUTHENTICATION, METHOD_NAME);  
  
     Boolean authenticated   = false;     Boolean authenticated   = false;
  
Line 81 
Line 75 
  
     if ( colon1 == PEG_NOT_FOUND )     if ( colon1 == PEG_NOT_FOUND )
     {     {
         PEG_FUNC_EXIT(TRC_AUTHENTICATION, METHOD_NAME);          PEG_METHOD_EXIT();
         return ( authenticated );         return ( authenticated );
     }     }
  
Line 90 
Line 84 
     // Look for another ':' seperator     // Look for another ':' seperator
     Uint32 colon2 = authHeader.find(colon1 + 1, ':');     Uint32 colon2 = authHeader.find(colon1 + 1, ':');
  
     if ( colon1 == PEG_NOT_FOUND )      String filePath;
   
       String secretReceived;
   
       if ( colon2 == PEG_NOT_FOUND )
     {     {
         PEG_FUNC_EXIT(TRC_AUTHENTICATION, METHOD_NAME);          filePath = String::EMPTY;
         return ( authenticated );  
     }  
  
     String filePath = authHeader.subString( colon1 + 1, (colon2 - colon1 - 1) );          secretReceived = authHeader.subString( colon1 + 1 );
       }
       else
       {
           filePath = authHeader.subString( colon1 + 1, (colon2 - colon1 - 1) );
  
     String secretReceived = authHeader.subString( colon2 + 1 );          secretReceived = authHeader.subString( colon2 + 1 );
       }
  
     authenticated = _localAuthenticator->authenticate(filePath,     authenticated = _localAuthenticator->authenticate(filePath,
         secretReceived, authInfo->getAuthChallenge());         secretReceived, authInfo->getAuthChallenge());
Line 108 
Line 109 
         authInfo->setAuthenticatedUser(userName);         authInfo->setAuthenticatedUser(userName);
     }     }
  
     PEG_FUNC_EXIT(TRC_AUTHENTICATION, METHOD_NAME);      PEG_METHOD_EXIT();
  
     return ( authenticated );     return ( authenticated );
 } }
  
 String LocalAuthenticationHandler::getAuthResponseHeader( String LocalAuthenticationHandler::getAuthResponseHeader(
     const String& authHeader,  
     AuthenticationInfo* authInfo)  
 {  
     const char METHOD_NAME[] =  
         "LocalAuthenticationHandler::getAuthResponseHeader()";  
   
     PEG_FUNC_ENTER(TRC_AUTHENTICATION, METHOD_NAME);  
   
     PEG_FUNC_EXIT(TRC_AUTHENTICATION, METHOD_NAME);  
   
     //  
     // No Implementation required in LocalAuthenticationHandler  
     //  
     return(String(""));  
 }  
   
 String LocalAuthenticationHandler::getAuthResponseHeader(  
     const String& authType,     const String& authType,
     const String& userName,     const String& userName,
     AuthenticationInfo* authInfo)     AuthenticationInfo* authInfo)
 { {
     const char METHOD_NAME[] =      PEG_METHOD_ENTER(TRC_AUTHENTICATION,
         "LocalAuthenticationHandler::getAuthResponseHeader()";          "LocalAuthenticationHandler::getAuthResponseHeader()");
   
     PEG_FUNC_ENTER(TRC_AUTHENTICATION, METHOD_NAME);  
  
     String challenge;     String challenge;
  
Line 147 
Line 129 
  
     authInfo->setAuthChallenge(challenge);     authInfo->setAuthChallenge(challenge);
  
     PEG_FUNC_EXIT(TRC_AUTHENTICATION, METHOD_NAME);      PEG_METHOD_EXIT();
  
     return(authResp);     return(authResp);
 } }


Legend:
Removed from v.1.3  
changed lines
  Added in v.1.5

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2