title: chrome.enterprise.deviceAttributes.getDirectoryDeviceId not working on enrolled chromebox
body: <p>I'm building a chrome kiosk app in ReactJS that needs to access the deviceId of the device it is running on for logging purposes. I use the following code to call chrome.enterprise.deviceAttributes.getDirectoryDeviceId:</p>
  
  <pre><code>const getDeviceId = (cb) =&gt; {
    if (!chrome.enterprise) {
      if (cb) {
        cb();
      }
  
      return;
    }
  
    // get device id
    chrome.enterprise.deviceAttributes.getDirectoryDeviceId(assetId =&gt; {
      deviceId = assetId;
  
      if (cb) {
        cb();
      }
    });
  };
  </code></pre>
  
  <p>Afterwards, the function is called by doing something along these lines: </p>
  
  <pre><code>getDeviceId(() =&gt; {
    debug('Got device id: %s', deviceId);
  });
  </code></pre>
  
  <p>Now, I know that this code can only work on a enrolled, ChromeOS device. I also know that the chrome.enterprise.deviceAttributes is only available to extensions that are pre-installed by policy. Because of this I can only test it after it is submitted to the ChromeOS store and is installed via the developer dashboard.</p>
  
  <p>Long story short: the above code doesn't return the deviceId and this causes all my api calls to fail, I can't really debug it because it gets installed as a kiosk app. I was wondering if anyone here could tell me what I'm doing wrong and how I can fix this.</p>
  
  <p>Thanks in advance!</p>