From fb20d7e9fae54e985800e30adbe80ebad4e8e981 Mon Sep 17 00:00:00 2001 From: Kanagaraj Manickam Date: Fri, 25 Sep 2020 15:45:30 +0530 Subject: Added Validation for Invalid Credentilas Issue-ID: DOVETAIL-801 Signed-off-by: Kanagaraj Manickam Change-Id: I35b35773847ecc9175ca634cb9ae1a341c9c2eeb --- opnfv_testapi/ui/auth/sign.py | 3 +++ 1 file changed, 3 insertions(+) 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) -- cgit 1.2.3-korg