Merge "additional logging to support debugging auth issue" into milestone-proposed
This commit is contained in:
commit
a05daf5f53
|
@ -224,6 +224,7 @@ class AuthProtocol(object):
|
||||||
if token:
|
if token:
|
||||||
return token
|
return token
|
||||||
else:
|
else:
|
||||||
|
LOG.warn("Unable to find authentication token in headers: %s", env)
|
||||||
raise InvalidUserToken('Unable to find token in headers')
|
raise InvalidUserToken('Unable to find token in headers')
|
||||||
|
|
||||||
def _reject_request(self, env, start_response):
|
def _reject_request(self, env, start_response):
|
||||||
|
@ -324,6 +325,7 @@ class AuthProtocol(object):
|
||||||
assert token
|
assert token
|
||||||
return token
|
return token
|
||||||
except (AssertionError, KeyError):
|
except (AssertionError, KeyError):
|
||||||
|
LOG.warn("Unexpected response from keystone service: %s", data)
|
||||||
raise ServiceError('invalid json response')
|
raise ServiceError('invalid json response')
|
||||||
|
|
||||||
def _validate_user_token(self, user_token, retry=True):
|
def _validate_user_token(self, user_token, retry=True):
|
||||||
|
@ -354,9 +356,10 @@ class AuthProtocol(object):
|
||||||
# FIXME(ja): I'm assuming the 404 status means that user_token is
|
# FIXME(ja): I'm assuming the 404 status means that user_token is
|
||||||
# invalid - not that the admin_token is invalid
|
# invalid - not that the admin_token is invalid
|
||||||
self._cache_store_invalid(user_token)
|
self._cache_store_invalid(user_token)
|
||||||
|
LOG.warn("Authorization failed for token %s", user_token)
|
||||||
raise InvalidUserToken('Token authorization failed')
|
raise InvalidUserToken('Token authorization failed')
|
||||||
if response.status == 401:
|
if response.status == 401:
|
||||||
LOG.info('Keystone rejected admin token, resetting')
|
LOG.info('Keystone rejected admin token %s, resetting', headers)
|
||||||
self.admin_token = None
|
self.admin_token = None
|
||||||
else:
|
else:
|
||||||
LOG.error('Bad response code while validating token: %s' %
|
LOG.error('Bad response code while validating token: %s' %
|
||||||
|
@ -365,6 +368,9 @@ class AuthProtocol(object):
|
||||||
LOG.info('Retrying validation')
|
LOG.info('Retrying validation')
|
||||||
return self._validate_user_token(user_token, False)
|
return self._validate_user_token(user_token, False)
|
||||||
else:
|
else:
|
||||||
|
LOG.warn("Invalid user token: %s. Keystone response: %s.",
|
||||||
|
user_token, data)
|
||||||
|
|
||||||
raise InvalidUserToken()
|
raise InvalidUserToken()
|
||||||
|
|
||||||
def _build_user_headers(self, token_info):
|
def _build_user_headers(self, token_info):
|
||||||
|
|
Loading…
Reference in New Issue