reSIProcate/DialogUsageManager  9694
Public Member Functions | Private Types | Private Attributes
resip::ClientAuthManager::AuthState Class Reference
Collaboration diagram for resip::ClientAuthManager::AuthState:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 AuthState ()
bool handleChallenge (UserProfile &userProfile, const SipMessage &challenge)
void addAuthentication (SipMessage &origRequest)
void authSucceeded ()

Private Types

typedef std::map< Data,
RealmState
RealmStates

Private Attributes

RealmStates mRealms
bool mFailed

Detailed Description

Definition at line 86 of file ClientAuthManager.hxx.


Member Typedef Documentation

Definition at line 95 of file ClientAuthManager.hxx.


Constructor & Destructor Documentation

ClientAuthManager::AuthState::AuthState ( )

Definition at line 182 of file ClientAuthManager.cxx.

                                      :
   mFailed(false)
{
}

Member Function Documentation

void ClientAuthManager::AuthState::addAuthentication ( SipMessage origRequest)

Definition at line 251 of file ClientAuthManager.cxx.

References resip::SipMessage::remove().

{
   request.remove(h_ProxyAuthorizations);
   request.remove(h_Authorizations);  

   if (mFailed) return;

   for(RealmStates::iterator i = mRealms.begin(); i!=mRealms.end(); i++)
   {
      i->second.addAuthentication(request);
   }
}

Here is the call graph for this function:

void ClientAuthManager::AuthState::authSucceeded ( )

Definition at line 242 of file ClientAuthManager.cxx.

{
   for(RealmStates::iterator i = mRealms.begin(); i!=mRealms.end(); i++)
   {
      i->second.authSucceeded();
   }
}
bool ClientAuthManager::AuthState::handleChallenge ( UserProfile userProfile,
const SipMessage challenge 
)

Definition at line 189 of file ClientAuthManager.cxx.

References resip::SipMessage::exists(), resip::SipMessage::header(), and InfoLog.

Referenced by resip::ClientAuthManager::handle().

{
   if (mFailed)
   {
      return false;
   }   
   bool handled = true;   
   if (challenge.exists(h_WWWAuthenticates))
   {
      for (Auths::const_iterator i = challenge.header(h_WWWAuthenticates).begin();  
           i != challenge.header(h_WWWAuthenticates).end(); ++i)                    
      {    
         if (i->exists(p_realm))
         {
            if (!mRealms[i->param(p_realm)].handleAuth(userProfile, *i, false))
            {
               handled = false;
               break;
            }
         }
         else
         {
            return false;
         }
      }
   }
   if (challenge.exists(h_ProxyAuthenticates))
   {
      for (Auths::const_iterator i = challenge.header(h_ProxyAuthenticates).begin();  
           i != challenge.header(h_ProxyAuthenticates).end(); ++i)                    
      {    
         if (i->exists(p_realm))
         {
            if (!mRealms[i->param(p_realm)].handleAuth(userProfile, *i, true))
            {
               handled = false;
               break;
            }
         }
      else
      {
         return false;
      }
      }
      if(!handled)
      {
         InfoLog( << "ClientAuthManager::AuthState::handleChallenge failed for: " << challenge);
      }
   }
   return handled;
}

Here is the call graph for this function:


Member Data Documentation

Definition at line 97 of file ClientAuthManager.hxx.

Definition at line 96 of file ClientAuthManager.hxx.


The documentation for this class was generated from the following files: