diff options
author | Kanagaraj Manickam <kanagaraj.manickam@huawei.com> | 2020-09-25 15:45:30 +0530 |
---|---|---|
committer | Kanagaraj Manickam <kanagaraj.manickam@huawei.com> | 2020-10-19 22:19:53 +0530 |
commit | fb20d7e9fae54e985800e30adbe80ebad4e8e981 (patch) | |
tree | 3fe93503c4f0672382b9789e500abe195ad9f314 /opnfv_testapi/ui/auth/sign.py | |
parent | 8adaa30570d7ab9d04928b4416f15ca16f0bdcc4 (diff) |
Added Validation for Invalid Credentilas
Issue-ID: DOVETAIL-801
Signed-off-by: Kanagaraj Manickam <kanagaraj.manickam@huawei.com>
Change-Id: I35b35773847ecc9175ca634cb9ae1a341c9c2eeb
Diffstat (limited to 'opnfv_testapi/ui/auth/sign.py')
-rw-r--r-- | opnfv_testapi/ui/auth/sign.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/opnfv_testapi/ui/auth/sign.py b/opnfv_testapi/ui/auth/sign.py index 29be209..6a9092a 100644 --- a/opnfv_testapi/ui/auth/sign.py +++ b/opnfv_testapi/ui/auth/sign.py @@ -311,5 +311,8 @@ class LoginHandler(base.BaseHandler): headers = {'Content-Type': 'application/x-www-form-urlencoded'} response = requests.post('https://identity.linuxfoundation.org', data=params, headers=headers) + response_text = response.content + if "unrecognized username or password" in response_text: + raises.Unauthorized(message.invalid_credentials()) resp = {'status': 'success'} self.finish_request(resp) |