HTTPCLIENT-1107: support auth scheme switching
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1175378 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
c4d1599bd0
commit
3853906d7d
|
@ -102,7 +102,7 @@ public abstract class AbstractAuthenticationHandler implements AuthenticationHan
|
|||
}
|
||||
int endIndex = pos;
|
||||
String s = buffer.substring(beginIndex, endIndex);
|
||||
map.put(s.toLowerCase(Locale.ENGLISH), header);
|
||||
map.put(s.toLowerCase(Locale.US), header);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
|
|
@ -79,10 +79,12 @@ public class HttpAuthenticator {
|
|||
String id = authScheme.getSchemeName();
|
||||
Header challenge = challenges.get(id.toLowerCase(Locale.US));
|
||||
if (challenge == null) {
|
||||
if (this.log.isWarnEnabled()) {
|
||||
this.log.warn(id + " authorization challenge expected, but not found");
|
||||
}
|
||||
return false;
|
||||
// Retry authentication with a different scheme
|
||||
authState.invalidate();
|
||||
authScheme = authHandler.selectScheme(challenges, response, context);
|
||||
authState.setAuthScheme(authScheme);
|
||||
id = authScheme.getSchemeName();
|
||||
challenge = challenges.get(id.toLowerCase(Locale.US));
|
||||
}
|
||||
authScheme.processChallenge(challenge);
|
||||
this.log.debug("Authorization challenge processed");
|
||||
|
|
Loading…
Reference in New Issue