@Contract(threading=IMMUTABLE) public class TargetAuthenticationStrategy extends Object
AuthenticationStrategy代理主机身份验证。
| Modifier and Type | Field and Description |
|---|---|
static TargetAuthenticationStrategy |
INSTANCE |
| Constructor and Description |
|---|
TargetAuthenticationStrategy() |
| Modifier and Type | Method and Description |
|---|---|
void |
authFailed(HttpHost authhost, AuthScheme authScheme, HttpContext context)
在不成功的身份验证的情况下调用回调。
|
void |
authSucceeded(HttpHost authhost, AuthScheme authScheme, HttpContext context)
在成功验证的情况下调用回调。
|
Map<String,Header> |
getChallenges(HttpHost authhost, HttpResponse response, HttpContext context)
生成挑战地图auth-scheme =>标题条目。
|
boolean |
isAuthenticationRequested(HttpHost authhost, HttpResponse response, HttpContext context)
确定给定的HTTP响应响应是否表示由于身份验证失败而发回的身份验证挑战。
|
protected boolean |
isCachable(AuthScheme authScheme) |
Queue<AuthOption> |
select(Map<String,Header> challenges, HttpHost authhost, HttpResponse response, HttpContext context)
选择所有可用的一个认证挑战,并创建并生成能够处理该挑战的 AuthOption实例。
|
public static final TargetAuthenticationStrategy INSTANCE
public boolean isAuthenticationRequested(HttpHost authhost, HttpResponse response, HttpContext context)
AuthenticationStrategy复制
isAuthenticationRequested在接口
AuthenticationStrategy
authhost - 认证主机。
response - HTTP响应。
context - HTTP上下文。
true如果需要用户认证,
false否则。
public Map<String,Header> getChallenges(HttpHost authhost, HttpResponse response, HttpContext context) throws MalformedChallengeException
getChallenges在接口
AuthenticationStrategy
authhost - 认证主机。
response - HTTP响应。
context - HTTP上下文。
MalformedChallengeException - 如果其中一个认证挑战无效或畸形。
public Queue<AuthOption> select(Map<String,Header> challenges, HttpHost authhost, HttpResponse response, HttpContext context) throws MalformedChallengeException
AuthenticationStrategy复制
AuthOption实例。
select在接口
AuthenticationStrategy
challenges - 挑战的集合。
authhost - 认证主机。
response - HTTP响应。
context - HTTP上下文。
MalformedChallengeException - 如果其中一个身份验证挑战无效或格式错误。
public void authSucceeded(HttpHost authhost, AuthScheme authScheme, HttpContext context)
AuthenticationStrategy复制
authSucceeded在接口
AuthenticationStrategy
authhost - 认证主机。
authScheme - 使用认证方案。
context - HTTP上下文。
protected boolean isCachable(AuthScheme authScheme)
public void authFailed(HttpHost authhost, AuthScheme authScheme, HttpContext context)
AuthenticationStrategy复制
authFailed在接口
AuthenticationStrategy
authhost - 认证主机。
authScheme - 使用认证方案。
context - HTTP context.
Copyright © 1999–2017 The Apache Software Foundation. All rights reserved.