Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

NTLM support for Network.createHTTPClient()?

Hello all,

I'm attempting to make a request to a REST based service that is protected by NTLM authentication. Does Network.CreateHTTPClient() support NTLM authentication?

I looked at the kitchen sink code and it has an example for Basic Auth (using setRequestHeader() to pass in an Authorization header) but this won't work for NTLM authentication.

I believe that Titanium is using ASIHTTPRequest under the hood, and it supports NTLM authentication, but I didn't see any way to hook into the setUsername, setPassword and setDomain parameters.

Any tips greatly appreciated. Thanks!

— asked November 19th 2010 by Darren Gibbons
  • authentication
  • iphone
  • mobile
  • ntlm
  • rest
0 Comments

4 Answers

  • Hmm, by reading TiNetworkHTTPClientProxy.m it looks like Titanium does not support NTLM authentication.

    However, I can hack it in by hardcoding a username, password and domain into the file by adding the following to the "open" method:

    [request setUsername:@"username"];
    [request setPassword:@"password"];
    [request setDomain:@"domain"];
    

    I've confirmed that this works.

    Questions:

    • How bad of an idea is it to hack the generated file? I'm guessing its pretty bad.
    • How often/what triggers the generation of these files?
    • It looks like adding proper support for NTLM to Titanium shouldn't be that hard. Assuming I code it in correctly, whats the odds of getting the code checked into the release?
    — answered November 20th 2010 by Darren Gibbons
    permalink
    0 Comments
  • Has anyone else found a way to perform NTLM authentication?

    — answered March 1st 2011 by Philippe Monnet
    permalink
    0 Comments
  • I want to connect to website that uses NTLM Authentication
    Can you please help me by a snap shot of your code

    Thans

    — answered September 14th 2011 by Haya aziz
    permalink
    1 Comment
    • NTLM Authentication problem is solved in Android 4.0

      — commented November 27th 2011 by Haya aziz
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.