OfficeDev / office-js-helpers

[ARCHIVED] A collection of helpers to simplify development of Office Add-ins & Microsoft Teams Tabs
MIT License
126 stars 57 forks source link

Missing any login dialog #129

Closed kosnkow closed 5 years ago

kosnkow commented 5 years ago

I created office addin , added necessary scripts but it does not work at all.

I run in in document ready

$(document).ready(() => {
    if (OfficeHelpers.Authenticator.isAuthDialog()) {
        return;
      }

      var authenticator = new OfficeHelpers.Authenticator();

      authenticator.endpoints.registerAzureADAuth("xxxxxxxxxxxxxxx", "xxxxxxxxxxxxx");

      authenticator
        .authenticate(OfficeHelpers.DefaultEndpoints.AzureAD)
        .then(function (token) { console.log(token) })
        .catch(OfficeHelpers.Utilities.log);
});

but I can't see any window for logging , the console log only print this http://i.imgur.com/6x6NFfG.png

If i change authenticate to this .authenticate(OfficeHelpers.DefaultEndpoints.AzureAD, true) then I got message: Cannot read property 'displayDialogAsync' of undefined