summaryrefslogtreecommitdiffstats
path: root/keystone/service.py
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2012-10-24 05:02:58 +0000
committerGerrit Code Review <review@openstack.org>2012-10-24 05:02:58 +0000
commit3b69d7ea9373b366dd239424b64f4dc47aad4801 (patch)
treee822f868e6737f6ded5945313e92ba7d1667f094 /keystone/service.py
parente89c762a4115402935cd9d406f5fd096ceb0c701 (diff)
parent7ac4d521103afa80c8f69c6b214a227c6a9346e3 (diff)
downloadkeystone-3b69d7ea9373b366dd239424b64f4dc47aad4801.tar.gz
keystone-3b69d7ea9373b366dd239424b64f4dc47aad4801.tar.xz
keystone-3b69d7ea9373b366dd239424b64f4dc47aad4801.zip
Merge "Fixes response for missing credentials in auth"
Diffstat (limited to 'keystone/service.py')
-rw-r--r--keystone/service.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/keystone/service.py b/keystone/service.py
index b5fb46f0..fdc895cb 100644
--- a/keystone/service.py
+++ b/keystone/service.py
@@ -292,6 +292,11 @@ class TokenController(wsgi.Application):
password = auth['passwordCredentials'].get('password', '')
tenant_name = auth.get('tenantName', None)
+ if not user_id and not username:
+ raise exception.ValidationError(
+ attribute='username or userId',
+ target='passwordCredentials')
+
if username:
try:
user_ref = self.identity_api.get_user_by_name(
@@ -300,6 +305,11 @@ class TokenController(wsgi.Application):
except exception.UserNotFound:
raise exception.Unauthorized()
+ if not password:
+ raise exception.ValidationError(
+ attribute='password',
+ target='passwordCredentials')
+
# more compat
tenant_id = auth.get('tenantId', None)
if tenant_name: