I am not sure what you have tried. If you are on Windows, you can try using
the native providers. I think these are officially unsupported (probably
because constantly testing this would require too much money / effort), but
they work.
HttpClientBuilder builder;
<snip>
Registry<AuthSchemeProvider> authSchemeRegistry =
RegistryBuilder.<AuthSchemeProvider>create()
.register(AuthSchemes.NTLM, new
WindowsNTLMSchemeFactory(null))
.register(AuthSchemes.SPNEGO, new
WindowsNegotiateSchemeFactory(null))
.register(AuthSchemes.DIGEST, new
DigestSchemeFactory())
.register(AuthSchemes.BASIC, new
BasicSchemeFactory())
.build();
<snip>
builder.setDefaultAuthSchemeRegistry(authSchemeRegistry);
If you don't want to use them, you can subclass a CredentialsProvider.
However, if you are on Windows, I would try the canned versions at first and
see if you can get it to work.
(If you create your own CredentialsProvider)
builder.setDefaultCredentialsProvider(credentialsProvider);
Do you check these email threads?
CredentialsProvider (started on 3/21/2016)
Proxy Authentication Strategy (started on 4/7/2016)
Proxy with digest authentication (started on 4/11/2016)
Disclaimer:
The opinions provided herein do not necessarily state or reflect those of
Donnell Systems, Inc.(DSI). DSI makes no warranty for and assumes no legal
liability or responsibility for the posting.
-----Original Message-----
From: Clemens Wyss DEV [mailto:[email protected]]
Sent: Wednesday, June 08, 2016 4:44 AM
To: [email protected]
Subject: HttpClient & NTLM-auth
I have read (and tested) hundreds (maybe only dozens ;)) of threads/posts
regarding HttpClient and NTLM auth.
-plain HttpClient (which I'd prefer!)
-jcifs
- spnego
- ...
None of the snippets I came along works out for me though, always ending up
with a 401.
Networksniffing shows, that no credential-negotiation/exchange is taking
place...
Taking the latest greatest HttpClient 4.5 what needs to be programmed and
configured(?) to get my java client to do NTLM authentication with a webservice
endpoint?
Do I need to follow anything mentioned here:
http://cr.openjdk.java.net/~weijun/special/krb5winguide-2/raw_files/new/kwin
Thanks for your advices/hints
- Clemens
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]