Skip to content

Commit a1a7d6d

Browse files
author
github-actions
committed
Merge branch 'main' into live
2 parents bb446cf + d6ea371 commit a1a7d6d

File tree

5 files changed

+56
-17
lines changed

5 files changed

+56
-17
lines changed
5.18 KB
Loading

docs/outlook/authenticate-a-user-with-an-sso-token.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ ms.localizationpriority: medium
77
---
88

99
# Authenticate a user with a single-sign-on token in an Outlook add-in
10+
[!INCLUDE [legacy-exchange-token-deprecation](../includes/legacy-exchange-token-deprecation.md)]
1011

1112
Single sign-on (SSO) provides a seamless way for your add-in to authenticate users (and optionally to obtain access tokens to call the [Microsoft Graph API](/graph/overview)).
1213

@@ -51,9 +52,6 @@ The add-in gets an SSO token with client-side script. For more information, see
5152

5253
In most scenarios, there would be little point to obtaining the access token, if your add-in does not pass it on to a server-side and use it there. For details on what your server-side could and should do, see [Add server-side code](../develop/sso-in-office-add-ins.md#pass-the-access-token-to-server-side-code).
5354

54-
> [!IMPORTANT]
55-
> When using the SSO token as an identity in an *Outlook* add-in, we recommend that you also [use the Exchange identity token](authenticate-a-user-with-an-identity-token.md) as an alternate identity. Users of your add-in may use multiple clients, and some may not support providing an SSO token. By using the Exchange identity token as an alternate, you can avoid having to prompt these users for credentials multiple times. For more information, see [Scenario: Implement single sign-on to your service in an Outlook add-in](implement-sso-in-outlook-add-in.md).
56-
5755
## SSO for event-based activation or integrated spam reporting
5856

5957
There are additional steps to take if your add-in uses event-based activation or integrated spam reporting (preview). For more information, see [Use single sign-on (SSO) or cross-origin resource sharing (CORS) in your event-based or spam-reporting Outlook add-in](use-sso-in-event-based-activation.md).

docs/outlook/faq-nested-app-auth-outlook-legacy-tokens.md

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Nested app authentication and Outlook legacy tokens deprecation FAQ
44
ms.service: microsoft-365
55
ms.subservice: add-ins
66
ms.topic: faq
7-
ms.date: 03/11/2025
7+
ms.date: 03/13/2025
88
---
99

1010
# Nested app authentication and Outlook legacy tokens deprecation FAQ
@@ -181,6 +181,11 @@ If legacy Exchange Online tokens are off, you'll see an error displayed in the c
181181

182182
![Screen shot of an error in the console window.](../images/script-lab-error-exchange-token.png)
183183

184+
The actual error and code can vary, but often you will see error code 9017 or 9018 along with the following error descriptions.
185+
186+
- `GenericTokenError: An internal error has occurred.`
187+
- `InternalServerError: The Exchange server returned an error. Please look at the diagnostics object for more information.`
188+
184189
If an add-in is affected by Exchange tokens turned off, you can turn them back on. For more information, see [Can I turn Exchange Online legacy tokens back on?](#can-i-turn-exchange-online-legacy-tokens-back-on).
185190

186191
## Outlook add-in migration FAQ
@@ -210,7 +215,10 @@ If your add-in is for Exchange on-premises only (for example, Exchange 2019), it
210215

211216
### What will happen to my Outlook add-ins if I don't migrate to NAA?
212217

213-
If you don't migrate your Outlook add-ins to NAA, they'll stop working as expected in Exchange Online. When Exchange tokens are turned off, Exchange Online will block legacy token issuance. Any add-in that uses legacy tokens won't be able to access Exchange online resources.
218+
If you don't migrate your Outlook add-ins to NAA, they'll stop working as expected in Exchange Online. When Exchange tokens are turned off, Exchange Online will block legacy token issuance. Any add-in that uses legacy tokens won't be able to access Exchange online resources. When your add-in calls an API that requests an Exchange token, such as `getUserIdentityTokenAsync`, it gets a generic error similar to the following with error codes such as 9017 or 9018.
219+
220+
- "GenericTokenError: An internal error has occurred."
221+
- "InternalServerError: The Exchange server returned an error. Please look at the diagnostics object for more information."
214222

215223
If your add-in only works on-premises or if your add-in is on a deprecation path, you may not need to update. However, most add-ins that access Exchange resources through EWS or Outlook REST must migrate to continue functioning as expected.
216224

@@ -294,29 +302,33 @@ Outlook 2016 and Outlook 2019 on Windows use the Trident+ or WebView2 based on v
294302
- For more information on when Trident+ or Webview2 is used, see [Browsers and webview controls used by Office Add-ins](../concepts/browsers-used-by-office-web-add-ins.md).
295303
- For more information on how to determine which webview is running, see [Support older Microsoft webviews and Office versions](../develop/support-ie-11.md#determine-the-webview-the-add-in-is-running-in-at-runtime)
296304

297-
### How do I validate the ID token or authenticate the user?
298-
299-
Using Exchange tokens, you can validate the ID token and use it to authorize the user to access your own resources. For more information, see [Authenticate a user with an identity token for Exchange](authenticate-a-user-with-an-identity-token.md). However, MSAL with Entra ID tokens does not use this approach.
305+
### What tokens does MSAL return and are there minimum scopes to request?
300306

301307
When you request a token through MSAL, it always returns three tokens.
302308

303-
|Token |Purpose |Scopes |
304-
|---------------|---------|---------|
305-
|ID token | Provides information about the user to the client (task pane). | `profile` and `openid` |
306-
|Refresh token | Refreshes the ID and access tokens when they expire. | `offline_access` |
307-
|Access token | Authenticates the user for specific scopes to a resource, such as Microsoft Graph. | Any resource scopes, such as `user.read`. |
309+
|Token |Purpose |Scopes | `AuthencationResult` property |
310+
|---------------|---------|---------|----------------------------|
311+
|ID token | Provides information about the user to the client (task pane). | `profile` and `openid` | `authResult.idToken` |
312+
|Refresh token | Refreshes the ID and access tokens when they expire. | `offline_access` | Not available. |
313+
|Access token | Authenticates the user for specific scopes to a resource, such as Microsoft Graph. | Any resource scopes, such as `user.read`. | `authResult.accessToken` |
308314

309315
MSAL always returns these three tokens. It requests the `profile`, `openid`, and `offline_access` as default scopes even if your token request doesn't include them. This ensures the ID and refresh tokens are requested. However, you must include at least one resource scope, such as `user.read` so that you get an access token. If not, the request can fail.
310316

311-
Passing the ID token over a network call to enable or authorize access to a service is a security anti-pattern. The token is intended only for the client (task pane) and there is no way for the service to reliably use the token to be sure the user has authorized access. For more information about ID token claims, see [https://learn.microsoft.com/en-us/entra/identity-platform/id-token-claims-reference](/entra/identity-platform/id-token-claims-reference).
317+
### Should I validate the ID token from MSAL?
318+
319+
No. This is a legacy authentication pattern that was used with Exchange tokens to authorize access to your own resources. Passing the ID token over a network call to enable or authorize access to a service is a security anti-pattern. The ID token is intended only for the client (task pane) and there is no way for the service to reliably use the token to be sure the user has authorized access. For more information about ID token claims, see [ID token claims reference](/entra/identity-platform/id-token-claims-reference).
312320

313321
It's very important that you always request an access token to your own services. The access token also includes the same ID claims, so you don't need to pass the ID token. Instead create a custom scope for your service. For more information about app registration settings for your own services, see [Protected web API: App registration](/entra/identity-platform/scenario-protected-web-api-app-registration). When your service receives the access token, it can validate it, and use ID claims from inside the access token.
314322

323+
### Why is the ID token not refreshed?
324+
325+
There is a known issue where MSAL sometimes doesn't refresh the ID token after it expires. This shouldn't cause any issues in your add-in since the ID token is only intended for use in your task pane to get basic user identity information, such as name and email. There's no reason to validate the ID token or check the expiration claim. If you need to authenticate the user to your own resources, use the access token which also contains user identity information. The ID token must never be passed outside of your client code that received it.
326+
315327
### How do I determine if the user is an online or on-premise account?
316328

317329
You can determine if the signed-in user has an Exchange Online account or on-premise Exchange account by using the [Office.UserProfile.accountType](/javascript/api/outlook/office.userprofile) property. If the account type property value is **enterprise**, then the mailbox is on an on-premises Exchange server. Note that volume-licensed perpetual Outlook 2016 doesn’t support the **accountType** property. To work around this, call the [ResolveNames](/exchange/client-developer/web-service-reference/resolvenames-operation) operation in Exchange Web Service (EWS) in the Exchange on-premise server to get the recipient types.
318330

319-
## How do I deploy my add-in to Microsoft AppSource
331+
### How do I deploy my add-in to Microsoft AppSource
320332

321333
If you're publishing a new add-in to Microsoft AppSource, it will need to go through a certification process. For more information, see [Publish your Office Add-in to Microsoft AppSource](../publish/publish-office-add-ins-to-appsource.md). If you're updating the manifest of an add-in that is already published to Microsoft AppSource, you need to go through the certification process again. You can update the add-in's source code on your web server any time without a need to go through the certification process.
322334

docs/testing/debug-add-ins-overview.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Debug Office Add-ins
33
description: Find the Office Add-in debugging guidance for your development environment.
44
ms.topic: overview
5-
ms.date: 12/21/2023
5+
ms.date: 03/20/2025
66
ms.localizationpriority: high
77
---
88

@@ -80,6 +80,15 @@ There is no desktop version of Office for Linux, so you'll need to [sideload the
8080

8181
To debug an add-in that is already in staging or production, attach a debugger from the UI of the add-in. For instructions, see [Attach a debugger from the task pane](attach-debugger-from-task-pane.md).
8282

83+
## Versions of office.js for debugging
84+
85+
There are debug versions of the Office JavaScript libraries. These versions are more human readable and easier to step through with a debugger. Use them when the Office JavaScript APIs aren't working as expected. Avoid using them when you publish and deploy your add-in.
86+
87+
The debug versions are found at the following CDN locations.
88+
89+
- Office JavaScript API library: `https://appsforoffice.microsoft.com/lib/1/hosted/office.debug.js`
90+
- Office JavaScript API (preview) library: `https://appsforoffice.microsoft.com/lib/beta/hosted/office.debug.js`
91+
8392
## See also
8493

8594
- [Runtimes in Office Add-ins](runtimes.md)

docs/word/word-add-ins-troubleshooting.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Troubleshoot Word add-ins
33
description: Learn how to troubleshoot development errors in Word add-ins.
4-
ms.date: 02/25/2025
4+
ms.date: 03/26/2025
55
ms.topic: troubleshooting
66
ms.localizationpriority: medium
77
---
@@ -108,6 +108,26 @@ The [Word.Table](/javascript/api/word/word.table) object is different from an [H
108108

109109
Similarly, don't use Word JavaScript APIs to interact with HTML table objects.
110110

111+
## Shape APIs can't find shapes
112+
113+
You have shapes in your document but for some reason, when you used the API to get shapes e.g., `context.document.body.shapes`, the result is that 0 shapes were found.
114+
115+
One possibility is that the Word template is outdated. If you created a new document from the default template yet you see "Compatibility Mode" in the Word window's title bar, consider updating your default template.
116+
117+
:::image type="content" source="../images/word-compatibility-mode.png" alt-text="Compatibility Mode displayed in Word window's title bar.":::
118+
119+
To change the default template, see [Change the Normal template (Normal.dotm)](https://support.microsoft.com/office/06de294b-d216-47f6-ab77-ccb5166f98ea).
120+
121+
1. Use the instructions to find the location of the Normal template on your machine.
122+
1. Ensure that Word is closed.
123+
1. Rename `Normal.dotm` in **File Explorer** or similar application. Or you can move `Normal.dotm` to another location.
124+
125+
> [!IMPORTANT]
126+
> Because you renamed or moved `Normal.dotm`, Word automatically creates a new version the next time you open Word. Any customizations in your original `Normal.dotm` won't transfer to the new version so you'll need to add your customizations to the new template.
127+
128+
1. Open Word and create a new document using the default template. You should no longer see "Compatibility Mode".
129+
1. Retry running your code using the Shape API.
130+
111131
## See also
112132

113133
- [Troubleshoot development errors with Office Add-ins](../testing/troubleshoot-development-errors.md)

0 commit comments

Comments
 (0)