public interface AuthScheme
验证方案应该能够支持以下功能:
认证方案可能是有状态的,涉及一系列质询 - 响应交换。
重要信息:此接口的实现必须还实现ContextAwareAuthScheme接口,以保持与较新版本的HttpClient的API兼容。
| Modifier and Type | Method and Description |
|---|---|
Header |
authenticate(Credentials credentials, HttpRequest request)
|
String |
getParameter(String name)
返回具有给定名称的身份验证参数(如果可用)。
|
String |
getRealm()
返回认证领域。
|
String |
getSchemeName()
返回给定认证方案的文本指定。
|
boolean |
isComplete()
认证过程可能涉及一系列质询 - 响应交换。
|
boolean |
isConnectionBased()
测试认证方案是否以每个连接为基础提供授权,而不是通常的每个请求的基础
|
void |
processChallenge(Header header)
处理给定的挑战令牌。
|
void processChallenge(Header header) throws MalformedChallengeException
header - 挑战头
MalformedChallengeException
String getSchemeName()
String getParameter(String name)
name - 要返回的参数的名称
String getRealm()
null 。
boolean isConnectionBased()
true如果方案是基于连接的,
false如果方案是基于请求的。
boolean isComplete()
true如果认证过程已经完成,否则为
false 。
@Deprecated Header authenticate(Credentials credentials, HttpRequest request) throws AuthenticationException
ContextAwareAuthScheme.authenticate(Credentials, HttpRequest, org.apache.http.protocol.HttpContext)
Credentials生成一个授权字符串。
credentials - 要用于验证的一组凭据
request - 请求被认证
AuthenticationException - 如果由于身份验证失败而无法生成授权字符串
Copyright © 1999–2017 The Apache Software Foundation. All rights reserved.