Fix to use renewal keystone token when re-authenticated

Change-Id: Ibffb32452e3362a76a0a78fdbd13cb082a49e597
Closes-Bug: 1428577
This commit is contained in:
Kazuki OIKAWA 2015-03-05 19:35:26 +09:00
parent 0e2de71ea3
commit 13015323df
1 changed files with 3 additions and 3 deletions

View File

@ -1804,10 +1804,10 @@ public final class SwiftRestClient {
* @param accessToken access token
* @throws SwiftInternalStateException if the client is not yet authenticated
*/
private void setAuthToken(HttpMethodBase method, AccessToken accessToken)
private void setAuthToken(HttpMethod method, AccessToken accessToken)
throws SwiftInternalStateException {
checkNotNull(accessToken,"Not authenticated");
method.addRequestHeader(HEADER_AUTH_KEY, accessToken.getId());
method.setRequestHeader(HEADER_AUTH_KEY, accessToken.getId());
}
/**
@ -1859,7 +1859,7 @@ public final class SwiftRestClient {
LOG.debug("Reauthenticating");
}
//re-auth, this may recurse into the same dir
authenticate();
setAuthToken(method, authenticate());
if (LOG.isDebugEnabled()) {
LOG.debug("Retrying original request");
}