Added Validation for Invalid Credentilas 73/71273/4
authorKanagaraj Manickam <kanagaraj.manickam@huawei.com>
Fri, 25 Sep 2020 10:15:30 +0000 (15:45 +0530)
committerKanagaraj Manickam <kanagaraj.manickam@huawei.com>
Mon, 19 Oct 2020 16:49:53 +0000 (22:19 +0530)
Issue-ID: DOVETAIL-801
Signed-off-by: Kanagaraj Manickam <kanagaraj.manickam@huawei.com>
Change-Id: I35b35773847ecc9175ca634cb9ae1a341c9c2eeb

opnfv_testapi/ui/auth/sign.py

index 29be209..6a9092a 100644 (file)
@@ -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)