PageRenderTime 20ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/mordor/http/negotiate.h

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