Skip to content

Commit 00d54ab

Browse files
author
github-actions
committed
Merge branch 'main' into live
2 parents 3f7e653 + cf2c5d0 commit 00d54ab

File tree

5 files changed

+72
-6
lines changed

5 files changed

+72
-6
lines changed

docs/develop/auth-save-passwords.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
title: Automatically save passwords in Microsoft Edge WebView2
3+
description: Learn how to enable WebView2 to save passwords when users sign in using your add-in.
4+
ms.localizationpriority: medium
5+
ms.date: 03/10/2025
6+
---
7+
8+
# Enable automatic password saving in Microsoft Edge WebView2
9+
10+
Most browsers can automatically save passwords on behalf of the user when they sign in. This helps users manage passwords in a secure environment. Microsoft Edge WebView2 also supports automatic password saving. When your add-in is loaded in Microsoft Office on Windows, Webview2 hosts your add-in. To enable automatic password saving, add HTML input controls for the username and password, as shown in the following HTML.
11+
12+
```html
13+
<div>
14+
<label for="username">Username:</label><br/>
15+
<input type="text" id="username" name="username" /><br/>
16+
17+
<label for="password">Password:</label><br/>
18+
<input type="password" id="password" name="password" /><br/>
19+
20+
<button id="btn" type="button">Sign in</button>
21+
</div>
22+
```
23+
24+
In the button click event handler for the sign-in button, call the authentication library of your choice to sign in the user. Once the sign-in is complete, redirect to a new web page. When WebView2 sees the redirect, and the username and password, it prompts the user to offer to automatically save the credentials. The following code shows how to handle the sign-in button click event.
25+
26+
```javascript
27+
async function btnSignIn() {
28+
// Get the username and password credentials entered by the user.
29+
const username = document.getElementById("username").value;
30+
const pwd = document.getElementById("password").value;
31+
32+
try {
33+
// Sign in the user. This is a placeholder for the actual sign-in logic.
34+
await signInUser(username, pwd);
35+
36+
// Redirect to a success page to trigger the password autosave.
37+
window.location.href = "/home.html";
38+
}
39+
catch (error) {
40+
console.error("Sign in failed: " + error);
41+
return;
42+
}
43+
}
44+
```
45+
46+
## How the user manages passwords
47+
48+
When the user enters a new password in your add-in, and your add-in redirects to a new web page, WebView2 asks the user if they want to save their username and password. The next time your add-in prompts for credentials, WebView2 automatically enters the user's account information.
49+
50+
:::image type="content" source="../images/edge-webview2-automatic-save-passwords.png" alt-text="The dialog from WebView2 prompting the user if they want to save their username and password.":::
51+
52+
Users remove saved passwords by deleting The WebView2 local cache folder at `%LOCALAPPDATA%\Microsoft\Office\16.0\Wef\webview2\`. If your add-in relies on automatically saving passwords, you should document this folder location so users can remove their passwords.
53+
54+
## Related content
55+
56+
- [Microsoft Edge WebView2](https://developer.microsoft.com/microsoft-edge/webview2)
57+
- [Browsers and webview controls used by Office Add-ins](../concepts/browsers-used-by-office-web-add-ins.md)

docs/develop/teams-toolkit-overview.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Create Office Add-in projects using Teams Toolkit
33
description: Learn how to create Office Add-in projects using Teams Toolkit.
4-
ms.date: 02/12/2025
4+
ms.date: 04/10/2025
55
ms.localizationpriority: high
66
---
77

@@ -38,8 +38,6 @@ Install the latest version of Teams Toolkit into Visual Studio Code as described
3838

3939
:::image type="content" source="../images/teams-toolkit-create-office-task-pane-capability.png" alt-text="The options in the App Features Using an Office Add-in dropdown menu. The option 'Task pane' is selected.":::
4040

41-
1. If you're making an Outlook add-in, the toolkit shows a **Programming Language** dropdown menu. Select either **TypeScript** or **JavaScript**. (For Excel, PowerPoint, and Word add-ins, a TypeScript project is always created.)
42-
1. If you're making an Outlook add-in, the toolkit shows a **Framework** dropdown menu. Select **Default** or **React**. (For Excel, PowerPoint, and Word add-ins, a default project is always created.)
4341
1. In the **Workspace Folder** dialog that opens, select the folder where you want to create the project.
4442
1. Give a name to the project (with no spaces) when prompted. Teams Toolkit will create the project with basic files and scaffolding. It will then open the project *in a second Visual Studio Code window*. Close the original Visual Studio Code window.
4543

@@ -72,8 +70,14 @@ Install the latest version of Teams Toolkit into Visual Studio Code as described
7270
7371
1. To stop debugging and uninstall the add-in, select **Run** | **Stop Debugging** in Visual Studio Code.
7472

73+
> [!NOTE]
74+
> If the preceding step seems to have no effect, uninstall the add-in by opening a **TERMINAL** in Visual Studio Code, and then running the command `npm run stop`. Closing the server window doesn't reliably stop the server and closing the Office application doesn't reliably cause Office to unacquire the add-in.
75+
7576
### Sideload in Outlook
7677

78+
> [!NOTE]
79+
> If your development computer is Windows, be sure that your Outlook client is classic Outlook for Windows, not [new Outlook on Windows](https://support.microsoft.com/office/656bb8d9-5a60-49b2-a98b-ba7822bc7627). There is currently a bug that prevents add-ins created with the Teams Toolkit from properly sideloading in new Outlook for Windows or in Outlook on the web.
80+
7781
1. Ensure that your account in your Microsoft 365 developer tenancy is also an email account in desktop Outlook. If it isn't, follow the guidance in [Add an email account to Outlook](https://support.microsoft.com/office/e9da47c4-9b89-4b49-b945-a204aeea6726).
7882
1. **Close Outlook desktop**.
7983
1. In Visual Studio Code, open Teams Toolkit.
@@ -91,6 +95,9 @@ Install the latest version of Teams Toolkit into Visual Studio Code as described
9195
9296
1. To stop debugging and uninstall the add-in, select **Run** | **Stop Debugging** in Visual Studio Code.
9397

94-
## Developing your project
98+
> [!NOTE]
99+
> If the preceding step seems to have no effect, uninstall the add-in by opening a **TERMINAL** in Visual Studio Code, and then running the command `npm run stop`. Closing the server window doesn't reliably stop the server and closing the Office application doesn't reliably cause Office to unacquire the add-in.
100+
101+
## Develop your project
95102

96103
Now you can change and develop the project. In places where the guidance in the Office Add-ins documentation branches depending on what type of manifest is being used, be sure to follow the guidance for the unified manifest.
20.9 KB
Loading

docs/publish/publish-office-add-ins-to-appsource.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ The following parameter values are used for the Script Lab installation link.
7171

7272
To create the link, use the following URL template as a reference.
7373

74-
`{{appName}}:https://api.addins.store.office.com/addinstemplate/{{language}}/{{correlationID}}/{{addinId}}/none/{{addinName}}.{{fileFormat}}?omexsrctype=1`
74+
`{{appName}}:https://api.addins.store.office.com/addinstemplate/{{language}}/{{correlationID}}/{{addinId}}/none/{{addinName}}.{{fileFormat}}?omexsrctype=1&isexternallink=1`
7575

7676
Change the placeholders in the URL as follows.
7777

@@ -93,7 +93,7 @@ Change the placeholders in the URL as follows.
9393

9494
For example, the following is an installation link for Script Lab in Word on Windows with en-US as the language.
9595

96-
`ms-word:https://api.addins.store.office.com/addinstemplate/en-US/228a829b-69d7-45f4-a338-c6aba330ec7e/WA104380862/none/Script%20Lab,%20a%20Microsoft%20Garage%20project.docx?omexsrctype=1`
96+
`ms-word:https://api.addins.store.office.com/addinstemplate/en-US/228a829b-69d7-45f4-a338-c6aba330ec7e/WA104380862/none/Script%20Lab,%20a%20Microsoft%20Garage%20project.docx?omexsrctype=1&isexternallink=1`
9797

9898
### Include the add-in in the installation of a Windows app or COM/VSTO add-in
9999

docs/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,8 @@ items:
185185
href: develop/auth-external-add-ins.md
186186
- name: Access Microsoft Graph
187187
href: develop/authorize-to-microsoft-graph-without-sso.md
188+
- name: Automatically save passwords in WebView2
189+
href: develop/auth-save-passwords.md
188190
- name: UI and UX
189191
items:
190192
- name: Overview

0 commit comments

Comments
 (0)