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
671 stars 96 forks source link

No way to get Accesstoken in ui-less script(Office on Windows). #1952

Closed vdboots closed 3 years ago

vdboots commented 3 years ago

No way to get Bootstraptoken in ui-less application

Your Environment

Expected behavior

When using a dialog or GetAccessToken()l it would return an accesstoken in an ui-less experience.

Current behavior

Both methods are not supported at the moment. so there is no secure way in Outlook for desktop to ui-less response

Steps to reproduce

  1. put a getaccesstoken(); method in a ui-less javascript method and it will break;
  2. try to open i dialog to get an bootstraptoken(or other way to authenticate) from ui less will not execute

Context

we would like to get graph data of the current user to see if the user information is correctly setup for this we need a way to identify the user without opening a Taskpane

exextoc commented 3 years ago

UI-Less can generally refer to two different ExtensionPoints. With ExecuteFunction (executed manually by users with a button on the ribbon), this should work, but I suspect you are using LaunchEvent (such as AutoRun on new mails), where this function is not supported yet on that ExtensionPoint.

lindalu-MSFT commented 3 years ago

Hi @vdboots You can suggest this by going to our feature request forum: https://aka.ms/m365dev-suggestions and click "submit an idea." If you do submit a feature suggestion, please put the link here in a comment. Thanks!

exextoc commented 3 years ago

For Event-Based Add-ins, we do not yet support getAccessToken API.

vdboots commented 3 years ago

Is there any timelime if this will be supported? i posted a question for the feature. It is supported on the web. But now there is now way to get u user token Event-Based.

exextoc commented 3 years ago

I cannot comment on the timeline for when this will be supported. This is a feature that we know is needed.

exextoc commented 3 years ago

We have fixed this bug. For the Semi-Annual Channel, the fix should be available in build 16.0.14326.20258 or later. For all other channels, the fix should be available in build 16.0.14425.10000 or later.

When an updated build is available depends on the release channel a customer is on.

vdboots commented 3 years ago

thanx great to hear ! 👍