OfficeDev / office-js-helpers

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

Blank authentication dialog in Windows Outlook #77

Open jasonjoh opened 6 years ago

jasonjoh commented 6 years ago

I'm using the attachments demo add-in. I'm debugging locally in Visual Studio.

As background, the add-in attempts to get an SSO token first, and if that fails, it falls back to use the Authenticator class from this library. If I run the add-in and don't do the steps under Provide user consent to the app in the README, the Authenticator prompt is triggered. I get a blank dialog.

This works a bit better in Outlook on the web, but only if I pass true in the second parameter to authenticate to force the dialog. If I don't, I tend to not get any dialog, but the token object passed to the callback doesn't have an access_token property.

The versions of office.helpers.min.js and office.helpers.js are the latest from the CDN.

authenticator
    .authenticate(OfficeHelpers.DefaultEndpoints.Microsoft, true)
    .then(function(token)) {...}