def acquire_token(self, context):
        """Gets an access token to access ms graph TI Upload service.
        Args:
            context: the authentication context
        Returns:
            A token access key.
        """
        scope = "https://management.azure.com/.default"

        try:
            result = context.acquire_token_silent([scope],
                                                account=None)
            if not result:
                result = context.acquire_token_for_client(scopes=[
                    scope])

            if 'access_token' in result:
                bearer_token = result['access_token']
                token_expiry_seconds = result['expires_in']
                return bearer_token, token_expiry_seconds
            else:
                error_code = result.get("error")
                error_message = result.get("error_description")
                logging.info("Error acquiring token for tenant with code: {0}".format(error_code))
                logging.info(error_message)
                raise ValueError(error_message)

        except requests.exceptions.RequestException as e:
            logging.info("Error acquiring token for tenant.")
            raise e
Gets an access token to access ms graph TI Upload service.
        Args:
            context: the authentication context
        Returns:
            A token access key.
        
Solutions/GreyNoiseThreatIntelligence/Data Connectors/GreyNoiseAPISentinelConnector/main.py