/mordor/http/negotiate.h
C Header | 38 lines | 25 code | 12 blank | 1 comment | 0 complexity | fabbef8d305528def3c5f46a476f3a1e MD5 | raw file
1#ifndef __MORDOR_HTTP_NEGOTIATE_AUTH_H__ 2#define __MORDOR_HTTP_NEGOTIATE_AUTH_H__ 3// Copyright (c) 2009 - Mozy, Inc. 4 5#include <security.h> 6 7#include <string> 8 9#include <boost/noncopyable.hpp> 10 11namespace Mordor { 12 13struct URI; 14 15namespace HTTP { 16 17struct AuthParams; 18struct Request; 19struct Response; 20 21class NegotiateAuth : public boost::noncopyable 22{ 23public: 24 NegotiateAuth(const std::string &username, const std::string &password); 25 ~NegotiateAuth(); 26 27 bool authorize(const AuthParams &challenge, AuthParams &authorization, 28 const URI &uri); 29 30private: 31 std::wstring m_username, m_password, m_domain; 32 CredHandle m_creds; 33 SecHandle m_secCtx; 34}; 35 36}} 37 38#endif