Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New --auth-type NTLM per https://github.com/jkbr/httpie/issues/76 #160

Closed
wants to merge 2 commits into from

Conversation

hickford
Copy link
Contributor

@hickford hickford commented Sep 2, 2013

New --auth-type NTLM per #76

This does authentication with the end server. It doesn't help if you want to NTLM-authenticate with the proxy, which is separate issue #159

@hickford
Copy link
Contributor Author

hickford commented Sep 7, 2013

If you have a Windows computer, you can test this feature. Install IIS Express, then change the out-the-box sample site 'WebSite1' to demand Windows authentication and refuse everything else. This is not uncommon for a corporate intranet site.

Edit Documents/IIS Express/applicationhost.config

<authentication>
    <anonymousAuthentication enabled="false" userName="" />
    <basicAuthentication enabled="false" />
    <clientCertificateMappingAuthentication enabled="false" />
    <digestAuthentication enabled="false" />
    <iisClientCertificateMappingAuthentication enabled="false">
    </iisClientCertificateMappingAuthentication>
    <windowsAuthentication enabled="true">
        <providers>
            <add value="Negotiate" />
            <add value="NTLM" />
        </providers>
    </windowsAuthentication>

Run iisexpress.exe

Successfully registered URL "http://localhost:8080/" for site "WebSite1" application "/"

Browse there in say Chrome and hit 'cancel' when it asks you to authenticate

HTTP Error 401.2 - Unauthorized
You are not authorized to view this page due to invalid authentication headers.

Similarly with httpie

> http --headers get localhost:8080
HTTP/1.1 401 Unauthorized

Suppose your Windows computer is called trinity, your user account matt and your password potatoes. Try the site again in Chrome. Enter the user name in the form trinity\\matt you should be able to log in.

HTTPie's Basic auth doesn't work, even with the correct credentials

> http --auth trinity\\matt:p0tatoes --headers get localhost:8080
HTTP/1.1 401 Unauthorized

But try again with new --auth-type NTLM

>http --auth-type NTLM --auth trinity\\matt:p0tatoes --headers get localhost:8080
HTTP/1.1 200 OK

Wahey!

@jkbrzt
Copy link
Member

jkbrzt commented Sep 16, 2013

Thanks @matt-hickford! I'm almost done with a simple plugin architecture though and it will be very easy to add this a plugin. Please follow #166.

@jkbrzt
Copy link
Member

jkbrzt commented Sep 21, 2013

Current master now supports auth plugins. NTLM plugin: https://github.com/jkbr/httpie-ntlm

@jkbrzt jkbrzt closed this Sep 21, 2013
@hickford hickford deleted the ntlm-auth branch September 21, 2013 22:08
@hickford
Copy link
Contributor Author

@jkbr great thanks. I like your plugin API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants