public interface AuthenticationStrategy
此接口的实现必须是线程安全的。 必须同步访问共享数据,因为可以从多个线程执行此接口的方法。
| 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)
从给定的HTTP响应中提取认证挑战的集合,每个认证挑战表示认证主机支持的认证方案。
|
boolean |
isAuthenticationRequested(HttpHost authhost, HttpResponse response, HttpContext context)
确定给定的HTTP响应响应是否表示由于身份验证失败而发回的身份验证挑战。
|
Queue<AuthOption> |
select(Map<String,Header> challenges, HttpHost authhost, HttpResponse response, HttpContext context)
从所有可用的中选择一个认证挑战,并创建并生成能处理该挑战的 AuthOption实例。
|
boolean isAuthenticationRequested(HttpHost authhost, HttpResponse response, HttpContext context)
authhost - 认证主机。
response - HTTP响应。
context - HTTP上下文。
true如果需要用户认证,否则为
false 。
Map<String,Header> getChallenges(HttpHost authhost, HttpResponse response, HttpContext context) throws MalformedChallengeException
authhost - 认证主机。
response - HTTP响应。
context - HTTP上下文。
MalformedChallengeException - 如果其中一个认证挑战无效或畸形。
Queue<AuthOption> select(Map<String,Header> challenges, HttpHost authhost, HttpResponse response, HttpContext context) throws MalformedChallengeException
AuthOption实例。
challenges - 挑战的集合。
authhost - 认证主机。
response - HTTP响应。
context - HTTP上下文。
MalformedChallengeException - 如果其中一个认证挑战无效或格式不正确。
void authSucceeded(HttpHost authhost, AuthScheme authScheme, HttpContext context)
authhost - 认证主机。
authScheme - 使用认证方案。
context - HTTP上下文。
void authFailed(HttpHost authhost, AuthScheme authScheme, HttpContext context)
authhost - 认证主机。
authScheme - 使用认证方案。
context - HTTP上下文。
Copyright © 1999–2017 The Apache Software Foundation. All rights reserved.