org.apache.http.impl.auth.SPNegoScheme Java Examples

The following examples show how to use org.apache.http.impl.auth.SPNegoScheme. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SessionConfigurator.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
private Header spnegoAuthenticate( boolean stripPort, URI uri ) throws Exception {
  SPNegoSchemeFactory spNegoSchemeFactory = new SPNegoSchemeFactory( stripPort );
  // using newInstance method instead of create method to be compatible httpclient library from 4.2 to 4.5
  // the create method was introduced at version 4.3
  SPNegoScheme spNegoScheme = (SPNegoScheme) spNegoSchemeFactory.newInstance( null );
  spNegoScheme.processChallenge( AUTHENTICATE_HEADER );
  return spNegoScheme.authenticate( credentials, new HttpGet( "" ), getContext( uri ) );
}