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

dialog error for native macOS Outlook Add-in #94

Closed jphilipps closed 6 years ago

jphilipps commented 6 years ago

Hello,

I just implemented the office-js-helpers into my Outlook Add-In. Unfortunately, there is a dialog token response problem. The Outlook Add-In works perfectly fine on the native Windows 10 Outlook. Same with Chrome, Firefox, IE11 and macOS Safari. The issue occurs with the native macOS Outlook. Libraries and software are up to date. As soon as the Add-in starts, the dialog displays a list of possible accounts for the token request (authentication). Whilst selecting the appropriate account, the user will be redirected to the login page immediately in order to insert the required credentials. This process happens in one dialog until it gets closed and the following error occurs: “the operation failed because there is already a dialog active for this add-in” (office.helpers.js: 4859-4860)

Why doesn't it work with the native macOS Outlook and how can I solve the problem (@Zlatkovsky @casieber )?

Thanks in advance!

...
this.authenticator
.authenticate(this.endpoint, true)
.then(response => {
return accessToken;
})
.catch(e => {
Utilities.log(e);
throw new Error("fetch auth token error: " + e);
});
...
this.authenticator.endpoints.add(this.endpoint, {
            clientId: CLIENT_ID,
            baseUrl:
                "https://login.windows.net/" +
                TENANT_ID,
            authorizeUrl: "/oauth2/authorize",
            resource: TokenHandler.getRootURL(urlEndpoint),
            //redirectUrl: REDIRECT, //default: window.location.origin
            responseType: "token",
            state: true, //default: false
            nonce: true //default: false
        });

...

WrathOfZombies commented 6 years ago

FYI @Zlatkovsky

jphilipps commented 6 years ago

Regarding the dialog error, two updates for the native Outlook Version on macOS were published some weeks ago. (16.14.0, 16.14.1, release-notes).

Fortunately the described error does no longer occur on my platform. Therefore it was rather a bug on Outlook I guess.

So if no one else is struggeling with this one still, I would suggest closing the issue.

Thanks for your support and efforts.