本文整理汇总了Java中org.apache.http.impl.auth.SPNegoScheme类的典型用法代码示例。如果您正苦于以下问题:Java SPNegoScheme类的具体用法?Java SPNegoScheme怎么用?Java SPNegoScheme使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SPNegoScheme类属于org.apache.http.impl.auth包,在下文中一共展示了SPNegoScheme类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: spnegoAuthenticate
import org.apache.http.impl.auth.SPNegoScheme; //导入依赖的package包/类
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 ) );
}