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

Outlook add-in with SSO using NAA sample does not work #4648

Closed LiamWarnes closed 3 months ago

LiamWarnes commented 3 months ago

Hi,

I've just cloned the sample available at https://github.com/OfficeDev/Office-Add-in-samples/blob/main/Samples/auth/Outlook-Add-in-SSO-NAA/README.md to find that it does not work with the provided instructions. We are working with this sample in hopes of finding a suitable replace for the upcoming deprecation of exchange tokens.

In particular, the sample includes use of an unknown Office.auth.getAuthContext method on the Indentity API that does not seem to be available on the included version or in office-js-preview version.

image

The method is used on line 73 of src/taskpane/authConfig.js and seems to be responsible for establishing an account prior to acquiring a token. To me, it would appear that this method is critical to the SSO metaphor for NAA.

During runtime, the method throws an exception when encountered

image

Please can you review the sample and ensure that it is working with the provided README instructions.

LiamWarnes commented 3 months ago

ok i have managed to resolve it.

for anyone reading who may encounter similar issues; i was not properly enrolled in the Insider program to get the beta build of Outlook. This method is available inside that build.

I had trouble following the provided instructions of how to get the beta build from the related articles for joining the insider program. For anyone having the same troubles I can suggest following the instructions at https://www.msoutlook.info/question/office-365-for-business-office-insider-fast-builds to enable the beta channel as a group policy on your local machine - be careful where you place the admx/adml folders inside Windows\PolicyDefinitions folder as the folder structure already exists there.

you can then edit the group policy by searching Edit group policy and subscribing to the beta channel

image

follow this up by applying updates inside outlook by going to account -> check for updates. you should now be on the beta build

cody-lettau commented 2 months ago

@exextoc when can we expect this to be GA and available on all platforms? It does not seem like a viable approach to not have this available in GA at least a month or two before fully deprecating Exchange Web Service token usage.

Also, I'd like to request that documentation is made available that outlines how the following is accomplished that can be shared with customers:

Exchange Online blocks legacy Exchange [user identity tokens](https://learn.microsoft.com/office/dev/add-ins/outlook/authentication#exchange-user-identity-token) and [callback tokens](https://learn.microsoft.com/office/dev/add-ins/outlook/authentication#callback-tokens) in all tenants by default. Add-ins that haven’t adopted NAA and rely on legacy Exchange tokens will be unable to call EWS and Outlook REST unless admins opt into continued legacy token issuance.

Specifically, the part about opting into continued use of legacy token issuance.