apache/httpclient — pull request #17 by xeronix (2014-09-05 08:41:24+00:00)
Title: Adding support for using delegated GSSCredential for Kerberos authentication

Internally httpclient relies on GSS API which uses JAAS login
configuration specified by user to get the GSSCredential. This patch
will allow a user to avoid the config file and directly set a delegated
or normal GSSCredential. A normal GSSCredential can be obtained
programatically from
spn-keytab or user-password using custom Login module.

Snippet to set GSSCredential for SPNEGO-KERBEROS Authentication :
//gssCredential is the GSSCredential Object
KerberosCredentials kerebrosCredential = new
KerberosCredentials(gssCredential);

CredentialsProvider credsProvider = new BasicCredentialsProvider();
credsProvider.setCredentials(new AuthScope(null, -1, null),
kerebrosCredential);

Registry authSchemeRegistry = RegistryBuilder
. create().register(AuthSchemes.SPNEGO,
new SPNegoSchemeFactory()).build();

Use this authSchemeRegistry for HttpClient.