OfficeDev / office-js

A repo and NPM package for Office.js, corresponding to a copy of what gets published to the official "evergreen" Office.js CDN, at https://appsforoffice.microsoft.com/lib/1/hosted/office.js.
https://learn.microsoft.com/javascript/api/overview
Other
687 stars 94 forks source link

OSF.DDA.Error 5001 when calling Office.auth.getAccessToken() on Outlook Email web #2793

Closed repl-mohan-krishna closed 2 years ago

repl-mohan-krishna commented 2 years ago

We are developing Taskpane add-in for outlook email. when we calling getAccesToken method, sometimes i'm getting 5001 error.

Your Environment

Expected behavior

Office.auth.getAccessToken() should return a Promise which resolves to the access token.

Current behavior

Office.auth.getAccessToken() returns a Promise which rejects with the error: { "name":"Internal Error", "message":"An internal error has occurred.", "code":5001 }

Useful logs

Screenshot (140)

exextoc commented 2 years ago

Can you confirm if there's any dialog already open through the addin while calling getAccessToken?

repl-mohan-krishna commented 2 years ago

No. pre authorization already done by admin through Microsoft 365 admin center. it won't show any dialog while calling getAccesToken method

exextoc commented 2 years ago

Can you share a code snippet where you are calling getAccessToken?

repl-mohan-krishna commented 2 years ago

image

Both values (allowSignIn,allowConsent ) are false always as user is already preauthorized at admin center((https://admin.microsoft.com).

exextoc commented 2 years ago

We have not been able to reproduce the issue with the given snippet. Can you share a manifest and test credentials for your add-in to OutlookExtensibility@M365x27035562.onmicrosoft.com if your add-in is publicly hosted so that we can investigate further?

ghost commented 2 years ago

This issue has been automatically marked as stale because it is marked as needing author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. Thank you for your interest in Office Add-ins!

ghost commented 2 years ago

This issue has been closed due to inactivity. Please comment if you still need assistance and we'll re-open the issue.

vyvo2412 commented 1 day ago

I also got this error OSF.DDA.Error Code: 5001 when I tried to use Office.context.mailbox.displayAppointmentFormAsync(). Any recs on this error?