(self, username, password)
return body
This call returns the following:
        {
            "userId":"XXX-XXXXXXX",
            "email":"user@example.com",
            "token":"2_5HicFJMXXXXX-S_7IuK2EqOUHXXXXXXXXXXX1CXKWTThgU18Va_XXXXXX5S00hUafv3PV_if_Bl_rhiFsDHYwhxI3CxlVnR5f3q2XXXXXX-Wnt9F7D82uN1f4cXXXXX-FMUsWF_6tMBqwn6DpzOaIB7ciJrnr2QJyKewbQouGM6",
            "paymentId":"XXXXXXXX",
            "authenticated":1472961381,
            "accountStatus":"registered",
            "serialNumber":"XXXXXXXXXXXXX",
            "countryCode":"US",
            "tocUpdate":false,
            "policyUpdate":false,
            "validEmail":true
        }
This call returns the following:
        {
            "userId":"XXX-XXXXXXX",
            "email":"user
This call returns the following : { userId : XXX - XXXXXXX email : user
def Login(self, username, password):
        """
        This call returns the following:
        {
            "userId":"XXX-XXXXXXX",
            "email":"user@example.com",
            "token":"2_5HicFJMXXXXX-S_7IuK2EqOUHXXXXXXXXXXX1CXKWTThgU18Va_XXXXXX5S00hUafv3PV_if_Bl_rhiFsDHYwhxI3CxlVnR5f3q2XXXXXX-Wnt9F7D82uN1f4cXXXXX-FMUsWF_6tMBqwn6DpzOaIB7ciJrnr2QJyKewbQouGM6",
            "paymentId":"XXXXXXXX",
            "authenticated":1472961381,
            "accountStatus":"registered",
            "serialNumber":"XXXXXXXXXXXXX",
            "countryCode":"US",
            "tocUpdate":false,
            "policyUpdate":false,
            "validEmail":true
        }
        """
        self.username = username
        self.password = password
        self.request = Request()

        headers = {
            'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 11_1_2 like Mac OS X) AppleWebKit/604.3.5 (KHTML, like Gecko) Mobile/15B202 NETGEAR/v1 (iOS Vuezone)',
        }
        self.request.options(f'https://{self.AUTH_URL}/api/auth', headers=headers)
        
        headers = {
            'DNT': '1',
            'schemaVersion': '1',
            'Auth-Version': '2',
            'Content-Type': 'application/json; charset=UTF-8',
            'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 11_1_2 like Mac OS X) AppleWebKit/604.3.5 (KHTML, like Gecko) Mobile/15B202 NETGEAR/v1 (iOS Vuezone)',
            'Origin': f'https://{self.BASE_URL}',
            'Referer': f'https://{self.BASE_URL}/',
            'Source': 'arloCamWeb',
        }

        #body = self.request.post(f'https://{self.BASE_URL}/hmsweb/login/v2', {'email': self.username, 'password': self.password}, headers=headers)
        body = self.request.post(
                f'https://{self.AUTH_URL}/api/auth',
            params={
                'email': self.username,
                'password': str(base64.b64encode(self.password.encode('utf-8')), 'utf-8'),
                'language': 'en',
                'EnvSource': 'prod'
            },
            headers=headers
        )
        headers['Authorization'] = body['token']

        self.request.session.headers.update(headers)

        self.user_id = body['userId']
        return body
def Login ( self , username , password ) : self . username = username self . password = password self . request = Request ( ) headers = { 'User-Agent' : 'Mozilla/5.0 (iPhone; CPU iPhone OS 11_1_2 like Mac OS X) AppleWebKit/604.3.5 (KHTML, like Gecko) Mobile/15B202 NETGEAR/v1 (iOS Vuezone)' , } self . request . options ( f'https://{self.AUTH_URL}/api/auth' , headers = headers ) headers = { 'DNT' : '1' , 'schemaVersion' : '1' , 'Auth-Version' : '2' , 'Content-Type' : 'application/json; charset=UTF-8' , 'User-Agent' : 'Mozilla/5.0 (iPhone; CPU iPhone OS 11_1_2 like Mac OS X) AppleWebKit/604.3.5 (KHTML, like Gecko) Mobile/15B202 NETGEAR/v1 (iOS Vuezone)' , 'Origin' : f'https://{self.BASE_URL}' , 'Referer' : f'https://{self.BASE_URL}/' , 'Source' : 'arloCamWeb' , } #body = self.request.post(f'https://{self.BASE_URL}/hmsweb/login/v2', {'email': self.username, 'password': self.password}, headers=headers) body = self . request . post ( f'https://{self.AUTH_URL}/api/auth' , params = { 'email' : self . username , 'password' : str ( base64 . b64encode ( self . password . encode ( 'utf-8' ) ) , 'utf-8' ) , 'language' : 'en' , 'EnvSource' : 'prod' } , headers = headers ) headers [ 'Authorization' ] = body [ 'token' ] self . request . session . headers . update ( headers ) self . user_id = body [ 'userId' ] return body