diff options
| author | Unmesh Gurjar <unmesh.gurjar@nttdata.com> | 2012-10-10 04:22:31 -0700 |
|---|---|---|
| committer | Unmesh Gurjar <unmesh.gurjar@nttdata.com> | 2012-10-25 00:27:50 -0700 |
| commit | 9ee3fba769274a84ea7709aa0068c19a421dbd80 (patch) | |
| tree | d5c328b56c15d3a4ecd106f06615621920551828 /keystone | |
| parent | 7db2f6aa595e2d1261bc59750519b59daab7ab07 (diff) | |
| download | keystone-9ee3fba769274a84ea7709aa0068c19a421dbd80.tar.gz keystone-9ee3fba769274a84ea7709aa0068c19a421dbd80.tar.xz keystone-9ee3fba769274a84ea7709aa0068c19a421dbd80.zip | |
Fixes 500 err on authentication for invalid body
1. This fixes the 500 error on authentication when invalid request body is
provided, a 400 Bad Request response is returned instead.
2. Also added unit test coverage.
Fixes LP: #1060709
Change-Id: I7f2916e0b91de1e299d2dc7a245ff6c2bc548afd
Diffstat (limited to 'keystone')
| -rw-r--r-- | keystone/service.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/keystone/service.py b/keystone/service.py index fdc895cb..c5fe9633 100644 --- a/keystone/service.py +++ b/keystone/service.py @@ -285,6 +285,9 @@ class TokenController(wsgi.Application): Alternatively, this call accepts auth with only a token and tenant that will return a token that is scoped to that tenant. """ + if not auth: + raise exception.ValidationError(attribute='auth', + target='request body') if 'passwordCredentials' in auth: user_id = auth['passwordCredentials'].get('userId', None) |
