NTLM auth support
[email protected] commented:
Which version of PhantomJS are you using? Tip: run 'phantomjs --version'. 1.8
Please provide any additional information below. There is currently no support for NTLM authentication. (NTLM is common in the Enterprise field and this is a must in my project)
also see https://groups.google.com/forum/#!topic/phantomjs/EoZ10-9puMk
thanks.
Disclaimer: This issue was migrated on 2013-03-15 from the project's former issue tracker on Google Code, Issue #1037. :star2: 3 people had starred this issue at the time of migration.
[email protected] commented:
If you can suggest any work-arounds in the interim, please do so, thanks.
Any news on this? I would really like to have NTLM authentication :-)
PhantomJS support NTLMv2 authentication.
Use page.settings to provide values for username/password
Doc: https://github.com/ariya/phantomjs/wiki/API-Reference-WebPage#wiki-webpage-settings
@Vitallium: I would assume the intent of this was for integrated NTLM authentication, i.e. automatically use the credentials of the user that is executing the PhantomJS process.
@willemmulder @sjrosent @arthurva: Can you guys clarify if that was your intent, or is the mechanism that Vitaliy mentioned enough to meet your needs?
Hmm, I use http://casperjs.org/api.html#casper.setHttpAuth from CasperJS to set the http auth headers. They should do the same as https://github.com/ariya/phantomjs/wiki/API-Reference-WebPage#wiki-webpage-settings (although I did not try that yet)... But what I get is "the requested method is not supported".
I did not necessarily mean for integrated NTLM authentication, but the topic starter might :-)
@JamesMGreene Qt 4.8.4 doesn't support automatic NTLM authentication :(
@willemmulder NTLM authentication doesn't use any of these HTTP headers: HTTP_AUTH_USER or HTTP_AUTH_PW.
It uses the Authorization HTTP header.
UPD Never mind, CasperJS sets it in the right way.
UPD2
@willemmulder Did you try to provide the username with the domain value, e.g. mydomain\\username?
http://darrendev.blogspot.jp/2013/04/phantomjs-post-auth-and-timeouts.html here is a blog said there is a bug when setting username and password with GET request and it suggest use
page.customHeaders={'Authorization': 'Basic '+btoa('username:password')}
to fix it. But the problem is I don't know how to build NTLM encoding string.
That might work for Basic authentication, but I assume it doesn't work for NTLM authentication...?
@willemmulder correct. I tested it against NTLM appliaction, it failed. And cant find how to generate NTLM encoding after google.
Yeah, too bad... Just wait until it is supported, I guess...!
http://fabricasapiens.nl voor websites
2013/4/12 raykin [email protected]
@willemmulder https://github.com/willemmulder correct. I tested it against NTLM appliaction, it failed. And cant find how to generate NTLM encoding after google.
— Reply to this email directly or view it on GitHubhttps://github.com/ariya/phantomjs/issues/11037#issuecomment-16282767 .
A google for NTLM authentication will give you plenty of resources, but it's not simple.
Any progress on this? Without NTLM support PhantomJS is a dead end in the enterprise market.
@BigBadOwl A multi-million-dollar enterprise organization also has another choice: contribute to this project (which is free to use by everyone, including such enterprise entities) to ensure that NTLM works well.
@ariya You are of course quite correct. If it meant enough to a big company to have NTLM support, then they could pay a developer with the knowledge and skills to do the work. Unfortunately, I am only using PhantomJS to automate some of my tasks to make my life easier, not something my company would shell out for I'm afraid. Thanks for PhantomJS BTW, it is awesome and most appreciated.
I have similar requirement where in my enterprise I am behind a firewall with NTLM/Kerberos authentication configured. None of the options --proxy-auth worked for me and I understood there is no NTLM support as of now. I am using PhantomJS 1.9.1. So, I am using a work-around for this by setting a local proxy on my machine (i used OWASP ZAP proxy). I configured my external proxy credentials in the ZAP, and passed my localhost zap proxy url with --proxy=localhost:8080 (i configured zap to run on port 8080 default). It worked like a gem and I am able to connect to external sites as ZAP is capable of doing NTLM authentication. I faced issue with https (SSL) sites later. But I understand the root cause is that the dynamic certificate created by ZAP is not getting validated. So, the moment i put --ignore-ssl-errors=yes, again I got the SSL sites content like a gem. Hope this work around help others too. I am newbie and today is firstday with phantomjs so, I am unaware of any other inbuilt options available to achieve this same instead of taking this workaround.
@ariya I want to confirm that {"WWW-Authenticate" : "Negotiate [token]"} header is not supported. I tried to manually create a token and set the header, but the http response gives "null" status and empty contents.
Does that mean this header entry is discarded from the request? Thanks.
For my previous comment, I was wrong. Actually the Kerberos header is accepted. Only the format is: page.customHeaders = {"Authorization": "Negotiate " + [token]};
To test, I accessed a kerberos website using OWASP ZAP to log all the request and response (thanks to @pkbharigopal ), and get the token from request header. Immediately copy the token to phantomjs and it worked!
However, the hard part is to automatically generate the token, you can use following packages: openssl/x509.h gssapi/gssapi.h gssapi/gssapi_krb5.h And a method named: gss_init_sec_context(...);
Has this been closed? There still does not appear to be NTLM authentication. Thanks
@tariqporter - it is not closed, it is still open. Verkurkie referenced a different issue. That one is closed.
@Vitallium, @JamesMGreene, from the follow-up discussion I take it that neither "automatic"/"integrated" NTLM authentication, nor NTML authentication in any form is currently supported. Escpecially after reading @raykin's comments. Is that correct?