Home | History | Annotate | Download | only in http
      1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 #ifndef NET_HTTP_HTTP_AUTH_HANDLER_NEGOTIATE_H_
      6 #define NET_HTTP_HTTP_AUTH_HANDLER_NEGOTIATE_H_
      7 
      8 #include "build/build_config.h"
      9 
     10 #include <string>
     11 
     12 #include "net/http/http_auth_handler.h"
     13 
     14 #if defined(OS_WIN)
     15 #include "net/http/http_auth_sspi_win.h"
     16 #endif
     17 
     18 namespace net {
     19 
     20 // Handler for WWW-Authenticate: Negotiate protocol.
     21 //
     22 // See http://tools.ietf.org/html/rfc4178 and http://tools.ietf.org/html/rfc4559
     23 // for more information about the protocol.
     24 
     25 class HttpAuthHandlerNegotiate : public HttpAuthHandler {
     26  public:
     27   HttpAuthHandlerNegotiate();
     28 
     29   virtual bool NeedsIdentity();
     30 
     31   virtual bool IsFinalRound();
     32 
     33   virtual std::string GenerateCredentials(const std::wstring& username,
     34                                           const std::wstring& password,
     35                                           const HttpRequestInfo* request,
     36                                           const ProxyInfo* proxy);
     37 
     38 
     39  protected:
     40   virtual bool Init(std::string::const_iterator challenge_begin,
     41                     std::string::const_iterator challenge_end);
     42 
     43  private:
     44   ~HttpAuthHandlerNegotiate();
     45 
     46 #if defined(OS_WIN)
     47   HttpAuthSSPI auth_sspi_;
     48 #endif
     49 };
     50 
     51 }  // namespace net
     52 
     53 #endif  // NET_HTTP_HTTP_AUTH_HANDLER_NEGOTIATE_H_
     54