-
Notifications
You must be signed in to change notification settings - Fork 804
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* update package and library versions * Add debug files * Remove getAuthContext parts as not needed for Outlook
- Loading branch information
1 parent
af99a9b
commit 7d634f2
Showing
13 changed files
with
2,615 additions
and
2,302 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
Samples/auth/Outlook-Add-in-SSO-NAA/.vscode/extensions.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
// See http://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations. | ||
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp | ||
|
||
// List of extensions which should be recommended for users of this workspace. | ||
"recommendations": [ | ||
"ms-edgedevtools.vscode-edge-devtools", | ||
"dbaeumer.vscode-eslint", | ||
"esbenp.prettier-vscode" | ||
], | ||
// List of extensions recommended by VS Code that should not be recommended for users of this workspace. | ||
"unwantedRecommendations": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Outlook Desktop (Edge Chromium)", | ||
"type": "msedge", | ||
"request": "attach", | ||
"port": 9229, | ||
"timeout": 600000, | ||
"webRoot": "${workspaceRoot}", | ||
"preLaunchTask": "Debug: Outlook Desktop", | ||
"postDebugTask": "Stop Debug" | ||
}, | ||
{ | ||
"name": "Outlook Desktop (Edge Legacy)", | ||
"type": "office-addin", | ||
"request": "attach", | ||
"url": "https://localhost:3000/taskpane.html?_host_Info=Outlook$Win32$16.01$en-US$$$$0", | ||
"port": 9222, | ||
"timeout": 600000, | ||
"webRoot": "${workspaceRoot}", | ||
"preLaunchTask": "Debug: Outlook Desktop", | ||
"postDebugTask": "Stop Debug" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"eslint.validate": [ | ||
"javascript", | ||
"javascriptreact", | ||
"typescript" | ||
] | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,156 @@ | ||
{ | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"label": "Build (Development)", | ||
"type": "npm", | ||
"script": "build:dev", | ||
"group": { | ||
"kind": "build", | ||
"isDefault": true | ||
}, | ||
"presentation": { | ||
"clear": true, | ||
"panel": "shared", | ||
"showReuseMessage": false | ||
} | ||
}, | ||
{ | ||
"label": "Build (Production)", | ||
"type": "npm", | ||
"script": "build", | ||
"group": "build", | ||
"presentation": { | ||
"clear": true, | ||
"panel": "shared", | ||
"showReuseMessage": false | ||
} | ||
}, | ||
{ | ||
"label": "Debug: Excel Desktop", | ||
"type": "shell", | ||
"command": "npm", | ||
"args": [ | ||
"run", | ||
"start:desktop", | ||
"--", | ||
"--app", | ||
"excel" | ||
], | ||
"presentation": { | ||
"clear": true, | ||
"panel": "dedicated" | ||
}, | ||
"problemMatcher": [] | ||
}, | ||
{ | ||
"label": "Debug: Outlook Desktop", | ||
"type": "shell", | ||
"command": "npm", | ||
"args": [ | ||
"run", | ||
"start:desktop", | ||
"--", | ||
"--app", | ||
"outlook" | ||
], | ||
"presentation": { | ||
"clear": true, | ||
"panel": "dedicated" | ||
}, | ||
"problemMatcher": [] | ||
}, | ||
{ | ||
"label": "Debug: PowerPoint Desktop", | ||
"type": "shell", | ||
"command": "npm", | ||
"args": [ | ||
"run", | ||
"start:desktop", | ||
"--", | ||
"--app", | ||
"powerpoint" | ||
], | ||
"presentation": { | ||
"clear": true, | ||
"panel": "dedicated" | ||
}, | ||
"problemMatcher": [] | ||
}, | ||
{ | ||
"label": "Debug: Word Desktop", | ||
"type": "shell", | ||
"command": "npm", | ||
"args": [ | ||
"run", | ||
"start:desktop", | ||
"--", | ||
"--app", | ||
"word" | ||
], | ||
"presentation": { | ||
"clear": true, | ||
"panel": "dedicated" | ||
}, | ||
"problemMatcher": [] | ||
}, | ||
{ | ||
"label": "Dev Server", | ||
"type": "npm", | ||
"script": "dev-server", | ||
"presentation": { | ||
"clear": true, | ||
"panel": "dedicated" | ||
}, | ||
"problemMatcher": [] | ||
}, | ||
{ | ||
"label": "Install", | ||
"type": "npm", | ||
"script": "install", | ||
"presentation": { | ||
"clear": true, | ||
"panel": "shared", | ||
"showReuseMessage": false | ||
}, | ||
"problemMatcher": [] | ||
}, | ||
{ | ||
"label": "Lint: Check for problems", | ||
"type": "npm", | ||
"script": "lint", | ||
"problemMatcher": [ | ||
"$eslint-stylish" | ||
] | ||
}, | ||
{ | ||
"label": "Lint: Fix all auto-fixable problems", | ||
"type": "npm", | ||
"script": "lint:fix", | ||
"problemMatcher": [ | ||
"$eslint-stylish" | ||
] | ||
}, | ||
{ | ||
"label": "Stop Debug", | ||
"type": "npm", | ||
"script": "stop", | ||
"presentation": { | ||
"clear": true, | ||
"panel": "shared", | ||
"showReuseMessage": false | ||
}, | ||
"problemMatcher": [] | ||
}, | ||
{ | ||
"label": "Watch", | ||
"type": "npm", | ||
"script": "watch", | ||
"presentation": { | ||
"clear": true, | ||
"panel": "dedicated" | ||
}, | ||
"problemMatcher": [] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,10 @@ This sample shows how to use MSAL.js nested app authentication (NAA) in an Outlo | |
|
||
## Applies to | ||
|
||
For a list of supported platforms, see [NAA supported accounts and hosts](https://learn.microsoft.com/office/dev/add-ins/develop/enable-nested-app-authentication-in-your-add-in#naa-supported-accounts-and-hosts). | ||
- Outlook (Current Channel (previeiw) for classic Outlook only, new Outlook coming soon). | ||
- Outlook on the web. | ||
|
||
For more information on supported platforms, see [NAA supported accounts and hosts](https://learn.microsoft.com/office/dev/add-ins/develop/enable-nested-app-authentication-in-your-add-in#naa-supported-accounts-and-hosts). | ||
|
||
## Prerequisites | ||
|
||
|
@@ -53,17 +56,6 @@ For a list of supported platforms, see [NAA supported accounts and hosts](https: | |
- Select **Register**. | ||
|
||
1. On the **Outlook-Add-in-SSO-NAA** page, copy and save the value for the **Application (client) ID**. You'll use it in the next section. | ||
1. Select the link to modify redirect URIs which should appear as **0 web, 1 spa, 0 public client**. | ||
|
||
![The redirect URIs link.](./assets/ui-add-redirect-link.png) | ||
|
||
1. In the **Single-page application Redirect URIs** section, select **Add URI**. | ||
|
||
![The Add URI link.](./assets/ui-add-redirects-link.png) | ||
|
||
1. Enter the new URI value `https://localhost:3000/taskpane.html` and select **Save**. | ||
|
||
![The completed redirects in the application registration.](./assets/ui-completed-redirects.png) | ||
|
||
For more information on how to register your application, see [Register an application with the Microsoft Identity Platform](https://learn.microsoft.com/graph/auth-register-app-v2). | ||
|
||
|
@@ -109,8 +101,8 @@ For more information on debugging with VS Code, see [Debugging](https://code.vis | |
The `src/taskpane/authConfig.ts` file contains the MSAL code for configuring and using NAA. It contains a class named AccountManager which manages getting user account and token information. | ||
|
||
- The `initialize` function is called from Office.onReady to configure and intitialize MSAL to use NAA. | ||
- The `ssoGetToken` function gets an access token for the signed in user to call Microsoft Graph APIs. | ||
- The `ssoGetUserIdentity` function gets the account information of the signed in user. This can be used to get user details such as name and email. | ||
- The `ssoGetAccessToken` function gets an access token for the signed in user to call Microsoft Graph APIs. | ||
- The `ssoGetUserAccount` function gets the account information of the signed in user. This can be used to get user details such as name and email. | ||
|
||
The `src/taskpane/taskpane.ts` file contains code that runs when the user chooses buttons in the task pane. They use the AccountManager class to get tokens or user information depending on which button is chosen. | ||
|
||
|
@@ -120,6 +112,15 @@ The `src/taskpane/msgraph-helper.ts` file contains code to construct and make a | |
|
||
If you find a security issue with our libraries or services, report the issue to [[email protected]](mailto:[email protected]) with as much detail as you can provide. Your submission may be eligible for a bounty through the [Microsoft Bounty](https://aka.ms/bugbounty) program. Don't post security issues to [GitHub Issues](https://github.com/AzureAD/microsoft-authentication-library-for-android/issues) or any other public site. We'll contact you shortly after receiving your issue report. We encourage you to get new security incident notifications by visiting [Microsoft technical security notifications](https://technet.microsoft.com/security/dd252948) to subscribe to Security Advisory Alerts. | ||
|
||
## More resources | ||
|
||
- NAA public preview blog: https://aka.ms/NAApreviewblog | ||
- [Updates on deprecating legacy Exchange Online tokens for Outlook add-ins](https://devblogs.microsoft.com/microsoft365dev/updates-on-deprecating-legacy-exchange-online-tokens-for-outlook-add-ins/?commentid=1131) | ||
- NAA docs to get started: https://aka.ms/NAAdocs | ||
- NAA FAQ: https://aka.ms/NAAFAQ | ||
- NAA Outlook sample: https://aka.ms/NAAsampleOutlook | ||
- NAA Word, Excel, and PowerPoint sample: https://aka.ms/NAAsampleOffice | ||
|
||
## Questions and feedback | ||
|
||
- Did you experience any problems with the sample? [Create an issue](https://github.com/OfficeDev/Office-Add-in-samples/issues/new/choose) and we'll help you out. | ||
|
Binary file removed
BIN
-39.8 KB
Samples/auth/Outlook-Add-in-SSO-NAA/assets/ui-add-redirect-link.png
Binary file not shown.
Binary file removed
BIN
-21.6 KB
Samples/auth/Outlook-Add-in-SSO-NAA/assets/ui-add-redirects-link.png
Binary file not shown.
Binary file removed
BIN
-19.1 KB
Samples/auth/Outlook-Add-in-SSO-NAA/assets/ui-completed-redirects.png
Binary file not shown.
Oops, something went wrong.