00001 // $Id: AuthenticationBase.h 90925 2010-06-29 10:50:40Z mcorino $ 00002 00003 /** 00004 * @file AuthenticationBase.h 00005 * 00006 * @author Martin Corino <mcorino@remedy.nl> 00007 */ 00008 00009 #ifndef ACE_INET_AUTHENTICATION_BASE_H 00010 #define ACE_INET_AUTHENTICATION_BASE_H 00011 00012 #include /**/ "ace/pre.h" 00013 00014 #include "ace/INet/INet_Export.h" 00015 #include "ace/SString.h" 00016 00017 ACE_BEGIN_VERSIONED_NAMESPACE_DECL 00018 00019 namespace ACE 00020 { 00021 namespace INet 00022 { 00023 /** 00024 * @class ACE_INet_AuthenticationBase 00025 * 00026 * @brief Base class for authentication information 00027 * holder. 00028 * 00029 */ 00030 class ACE_INET_Export AuthenticationBase 00031 { 00032 public: 00033 /// Destructor 00034 virtual ~AuthenticationBase (); 00035 00036 /// Returns authentication scheme (f.i. 'ftp' or 'http:basic'). 00037 virtual const ACE_CString& scheme () const = 0; 00038 00039 /// Returns authentication realm. 00040 virtual const ACE_CString& realm () const = 0; 00041 00042 /// Returns user id. 00043 virtual const ACE_CString& user () const = 0; 00044 00045 /// Changes user id. 00046 virtual void user (const ACE_CString& usr) = 0; 00047 00048 /// Returns password. 00049 virtual const ACE_CString& password () const = 0; 00050 00051 /// Changes password. 00052 virtual void password (const ACE_CString& pw) = 0; 00053 00054 protected: 00055 /// Constructor 00056 AuthenticationBase (); 00057 }; 00058 00059 /** 00060 * @class ACE_INet_AuthenticatorBase 00061 * 00062 * @brief Base class for authenticators. 00063 * 00064 */ 00065 class ACE_INET_Export AuthenticatorBase 00066 { 00067 public: 00068 /// Destructor 00069 virtual ~AuthenticatorBase (); 00070 00071 /// Verifies authentication for given info and returns true if 00072 /// verification succeeded, false otherwise. 00073 /// If true, the authentication information is updated with the actual 00074 /// credentials. 00075 virtual bool authenticate(AuthenticationBase& authentication) const = 0; 00076 }; 00077 } 00078 } 00079 00080 ACE_END_VERSIONED_NAMESPACE_DECL 00081 00082 #if defined (__ACE_INLINE__) 00083 #include "ace/INet/AuthenticationBase.inl" 00084 #endif 00085 00086 #include /**/ "ace/post.h" 00087 #endif /* ACE_INET_AUTHENTICATION_BASE_H */