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
668 stars 95 forks source link

OfficeRuntime.auth.getAccessToken() throws an error on Firefox browser windows 64 bit #4695

Closed avisheknand closed 1 month ago

avisheknand commented 1 month ago

Making any call to getting the office access token on Firefox browser (OfficeRuntime.auth.getAccessToken()) throws an unexpected error occurred in the client with code 13006 even when the requirement set is being supported

Your Environment

Expected behavior

The call to OfficeRuntime.auth.getAccessToken() should return the access token

Current behavior

The call to OfficeRuntime.auth.getAccessToken() throws the error image

Steps to reproduce

1.) Download Firefox and have the default settings setup 1.) Created a simple office app 2.) Make a call to get office access token (i.e. const accesstoken = await OfficeRuntime.auth.getAccessToken({ allowSignInPrompt: true, allowConsentPrompt: true});

How can we resolve this issue?

neprasad-microsoft commented 1 month ago

Hi @avisheknand, this is happening because of 3P cookie blocking on Safari. If you disable this from your Privacy settings it should work. The workaround for this is documented here - https://learn.microsoft.com/en-us/entra/identity-platform/reference-third-party-cookies-spas

We would also suggest moving to NAA which is in Preview right now - https://learn.microsoft.com/en-us/office/dev/add-ins/develop/enable-nested-app-authentication-in-your-add-in https://learn.microsoft.com/en-us/office/dev/add-ins/develop/enable-nested-app-authentication-in-your-add-in

microsoft-github-policy-service[bot] commented 1 month 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!

microsoft-github-policy-service[bot] commented 1 month ago

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