title: How to login to Confluence when kerberos authentication is used programatically
body: <p>We have Confluence Server 4.1 version installed. It is using AD authentication (Kerberos/Windows Security).</p>
  
  <p>When we enter the confluence server URL in the address bar of browser, then it shows following pop-up windows for entering the credentials.</p>
  
  <p><img src="https://i.stack.imgur.com/R1rrR.png" alt="enter image description here"></p>
  
  <p>Users access Confluence through their local machines when they’re logged onto the domain. They are already logged into the domain, so are not prompted for a login. Users can easily view, add pages in Spaces.</p>
  
  <p>We have followincg C# code to connect to Confluence, but it could not connect.
  ....</p>
  
  <pre><code>ConfluenceSoapServiceService service = new ConfluenceSoapServiceService();     
  service.Url = "http://confluence/rpc/soap-axis/confluenceservice-v2";     
  service.UseDefaultCredentials = true
  Token token = service.login(username, password);
  </code></pre>
  
  <p>....
  It throws following exception from the last line while calling serviec.login() method:</p>
  
  <p>Error connecting to Confluence server url ''. Please check ServerAddress, Username and Password. System.Web.Services.Protocols.SoapException: com.atlassian.confluence.rpc.AuthenticationFailedException: Attempt to log in user 'null' failed - incorrect username/password combination.
  at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
  at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
  at ConfluenceAPIWebsServiceVersion2.ConfluenceSoapServiceService.login</p>
  
  <p>Remote API (XML-RPC &amp; SOAP) was already enabled. Basically, I wanted to login and get the token - which can be later passed for calling other functions of the soap API.</p>
  
  <p>Could anybody shed some light on how to connect\login to Confluence?</p>
  
  <pre><code>Ref: https://answers.atlassian.com/questions/7674/does-the-appfusions-kerberos-sso-authenticator-for-confluence-work-with-the-confluence-remote-api
  </code></pre>