summarylogtreecommitdiffstats
path: root/check_token.patch
blob: afdbe0d92076740ac18c2a40838d2eaaedd1a2f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
From 34b6ce697429892141ad511d5e8e4b95e40abb98 Mon Sep 17 00:00:00 2001
From: zecoj <zecoj@users.noreply.github.com>
Date: Wed, 8 Mar 2017 11:24:10 +1100
Subject: [PATCH] Update check_token to reflect url change

---
 vipaccess/utils.py | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/vipaccess/utils.py b/vipaccess/utils.py
index f91b615..4ced9c9 100644
--- a/vipaccess/utils.py
+++ b/vipaccess/utils.py
@@ -254,15 +254,21 @@ def generate_qr_code(uri):
 def check_token(token_id, secret):
     '''Check the validity of the generated token.'''
     otp = totp(binascii.b2a_hex(secret).decode('utf-8'))
-    test_url = 'https://idprotect.vip.symantec.com/testtoken.v'
+    test_url = 'https://vip.symantec.com/otpCheck'
     token_check = requests.post(
         test_url,
-        data=dict(
-            tokenID=token_id,
-            firstOTP=otp
-            )
+        data={
+            'cr1':otp[0],
+            'cr2':otp[1],
+            'cr3':otp[2],
+            'cr4':otp[3],
+            'cr5':otp[4],
+            'cr6':otp[5],
+            'cred':token_id,
+            'continue':'otp_check'
+            }
         )
-    if "Your credential is functioning properly and is ready for use" in token_check.text:
+    if "Your VIP Credential is working correctly" in token_check.text:
         return True
     else:
         return False