reSIProcate/DialogUsageManager  9694
RADIUSServerAuthManager.hxx
Go to the documentation of this file.
00001 
00002 #ifndef __RADIUSServerAuthManager_h
00003 #define __RADIUSServerAuthManager_h
00004 
00005 #ifdef HAVE_CONFIG_H
00006 #include "config.h"
00007 #endif
00008 
00009 #ifdef USE_RADIUS_CLIENT
00010 
00011 #include "rutil/RADIUSDigestAuthenticator.hxx"
00012 #include "resip/dum/ServerAuthManager.hxx"
00013 
00014 namespace resip
00015 {
00016 
00017 class RADIUSServerAuthManager : public resip::ServerAuthManager {
00018 
00019 private:
00020   resip::DialogUsageManager& dum;
00021 
00022 public:
00023   RADIUSServerAuthManager(resip::DialogUsageManager& dum);
00024   virtual ~RADIUSServerAuthManager();
00025 
00026 protected:
00027   resip::ServerAuthManager::AsyncBool requiresChallenge(const resip::SipMessage& msg);
00028   void requestCredential(const resip::Data& user, const resip::Data& realm, const resip::SipMessage& msg, const resip::Auth& auth, const resip::Data& transactionId);
00029   bool useAuthInt() const;
00030 
00031   bool authorizedForThisIdentity(const resip::Data &user, const resip::Data &realm, resip::Uri &fromUri);
00032 
00033   void onAuthSuccess(const resip::SipMessage& msg);
00034   void onAuthFailure(resip::ServerAuthManager::AuthFailureReason reason, const resip::SipMessage& msg);
00035 
00036 };
00037 
00038 class MyRADIUSDigestAuthListener : public RADIUSDigestAuthListener {
00039 private:
00040   resip::Data user;
00041   resip::Data realm;
00042   resip::TransactionUser& tu;
00043   resip::Data transactionId;
00044 public:
00045   MyRADIUSDigestAuthListener(const resip::Data& user, const resip::Data& realm, resip::TransactionUser& tu, const resip::Data& transactionId);
00046   virtual ~MyRADIUSDigestAuthListener();
00047   void onSuccess(const resip::Data& rpid);
00048   void onAccessDenied();
00049   void onError();
00050 };
00051 
00052 }
00053 
00054 #endif
00055 
00056 #endif
00057