Example usage for org.apache.http.impl.auth SPNegoScheme authenticate

List of usage examples for org.apache.http.impl.auth SPNegoScheme authenticate

Introduction

In this page you can find the example usage for org.apache.http.impl.auth SPNegoScheme authenticate.

Prototype

@Override
public Header authenticate(final Credentials credentials, final HttpRequest request, final HttpContext context)
        throws AuthenticationException 

Source Link

Document

Produces SPNEGO authorization Header based on token created by processChallenge.

Usage

From source file:org.pentaho.di.trans.ael.websocket.SessionConfigurator.java

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));
}