2 * @file HTTP_BasicAuthentication.h
4 * @author Martin Corino <mcorino@remedy.nl>
7 #ifndef ACE_HTTP_BASIC_AUTHENTICATION_H
8 #define ACE_HTTP_BASIC_AUTHENTICATION_H
10 #include /**/ "ace/pre.h"
12 #include /**/ "ace/config-all.h"
14 #if !defined (ACE_LACKS_PRAGMA_ONCE)
16 #endif /* ACE_LACKS_PRAGMA_ONCE */
18 #include "ace/INet/INet_Export.h"
19 #include "ace/INet/HTTP_Request.h"
21 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
28 * @class ACE_HTTP_BasicAuthentication
30 * @brief Provides support for HTTP Basic Authentication credentials.
33 class ACE_INET_Export BasicAuthentication
37 BasicAuthentication();
39 /// Constructor. Sets user id and password.
40 BasicAuthentication(const ACE_CString
& user
, const ACE_CString
& passwd
);
42 /// Constructor. Decodes cedentials from request (if any).
43 BasicAuthentication(const Request
& request
);
46 virtual ~BasicAuthentication();
49 void user (const ACE_CString
& user
);
52 const ACE_CString
& user () const;
55 void password (const ACE_CString
& passwd
);
58 const ACE_CString
& password () const;
60 /// Add authentication header with encoded credentials to request.
61 void set_credentials (Request
& request
) const;
63 static const char* SCHEME
;
67 BasicAuthentication(const BasicAuthentication
&);
68 BasicAuthentication
& operator =(BasicAuthentication
&);
76 ACE_END_VERSIONED_NAMESPACE_DECL
78 #if defined (__ACE_INLINE__)
79 #include "ace/INet/HTTP_BasicAuthentication.inl"
82 #include /**/ "ace/post.h"
83 #endif /* ACE_HTTP_BASIC_AUTHENTICATION_H */