def refresh_oauth(self):
        '''
        Refresh access token using the refresh token
        - Stores the new access token in the Azure Vault and in this object
        - If the refresh token has expired, requests a new refresh and access token
          and stores them in the Azure Vault and in this object
        '''
        try:
            response = requests.post(self.api_domain + "/oauth/token",
                                    data="refresh_token={}&grant_type=refresh_token"
                                    .format(self.refresh_token),
                                    headers=self.refresh_header())
            response_content = json.loads(response.text)
            if 'access_token' in response_content:
                self.access_token = response_content['access_token']
                self.az_kv.set_secret("AccessToken", self.access_token)
                self.az_kv.set_secret("IsValid", "YES")
                self.az_kv.set_secret("AuthRetryCounter", 1)
            else:
                # if the refresh failed, request brand new API credentials
                response = requests.post(self.api_domain + "/oauth/token",
                                        data="grant_type=client_credentials",
                                        headers=self.header(self.api_key))
                response_content = json.loads(response.text)
                if 'access_token' in response_content:
                    self.access_token = response_content['access_token']
                    self.refresh_token = response_content['refresh_token']
                    self.az_kv.set_secret("AccessToken", self.access_token) 
                    self.az_kv.set_secret("RefreshToken", self.refresh_token)
                    self.az_kv.set_secret("IsValid", "YES")
                    self.az_kv.set_secret("AuthRetryCounter", 1)
                else:
                    if response_content['error'] and response_content['error'] == 'invalid_client':
                        # Set flag to avoid unwanted retries in case of invalid key/client
                        self.retry_counter = int(self.retry_counter) + 1
                        self.az_kv.set_secret("AuthRetryCounter", self.retry_counter)
                        if int(self.retry_counter) >= 10:
                            self.az_kv.set_secret("IsValid", "NO")

                    logging.error("Your Lookout application key has expired. " +
                                "Please get a new key and set up this connector app again.\n" +
                                "Go to https://mtp.lookout.com and generate a new key by " +
                                "navigating to System => Application Keys.")
                    logging.error("Exiting...")
                    sys.exit(1)
        except requests.exceptions.ProxyError as e:
            logging.error("Cannot connect to proxy. Remote end closed connection without response")            
        except requests.exceptions.RequestException as e:
            logging.error(e)

        Refresh access token using the refresh token
        - Stores the new access token in the Azure Vault and in this object
        - If the refresh token has expired, requests a new refresh and access token
          and stores them in the Azure Vault and in this object
        
Solutions/Lookout/Data Connectors/LookoutAPISentinelConnector/mes_request.py