generator-office: SSO Example fails with UnhandledPromiseRejection
Hello.
I used the following tutorial to create a Outlook-Addin with SSO and Microsoft Graph support enabled.
However, like it is also mentioned on the page, I configured the Addin using this tutorial, creating the entry in Azure AD and everything.
After doing all these steps and running npm, I get the following error message:
[0] [0] > office-addin-taskpane-sso@0.0.0 start:server C:\Desktop\Addin [0] > office-addin-sso start manifest.xml [0] [0] (node:10640) UnhandledPromiseRejectionWarning: false [0] (node:10640) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag
--unhandled-rejections=strict(see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1) [0] (node:10640) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. [0] npm run start:server exited with code 0
I have followed the tutorial exactly as described, but still the error remains. I am using:
- Windows 10 Build 18363
- Node v12.16.3
- Yeoman v3.1.1
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: 3020ff5d-ee3b-976b-f1ad-0ed378fdb47b
- Version Independent ID: 5de0010a-6435-154b-a7fd-fd2ea05ebc0b
- Content: Use the Yeoman generator to create an Office Add-in that uses SSO (preview) - Office Add-ins
- Content Source: docs/quickstarts/sso-quickstart.md
- Product: non-product-specific
- Technology: add-ins
- GitHub Login: @o365devx
- Microsoft Alias: o365devx
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 49 (16 by maintainers)
For anyone that wants to use
.envfile to store the CLIENT_SECRET and doesn’t want to fork the package or run the whole configure-sso script, I made a short script that only does the secret adding into windows credentials part using the ps1 script from the library.Just drop this script into the root of your project and anyone that will clone the project fresh can simply run it with a command like this:
@Chris2011 I created a Microsoft Learning module on this topic… I tried to be a bit more clean than the docs are on this credential store & how it works: https://docs.microsoft.com/en-us/learn/modules/office-add-ins-sso/7-exercise-outlook-sso
Jump down to the section Update project and developer workstation for the POSH (on Windows) or CLI (on macOS) options
This is still an issue for mac, its happening in the getSecretFromCredentialStore function:
In the above code the win32 case wraps ${ssoAppName} in double quotes and in the darwin case it doesn’t. Once you add the double quotes it works as expected.
@davidchesnut
Thanks for the quick response. Your suggestions have been very helpful.
Thx @andrewconnell. It looks much cleaner and better 😃. Thx a alot.
Doing the SSO quickstart here: https://docs.microsoft.com/en-us/office/dev/add-ins/quickstarts/sso-quickstart#configure-sso
Specifically, it says:
This doesn’t tell you what to do with the secret. I was able to run configure-sso so I’m past that. Now I just need to figure out why Excel isn’t opening when I run the project 😄
I just found that it might be related to add-in name provided during configuration. When I provided name with spaces (as proposed on microsoft documentation) I’m getting the above problem. but when I used ‘-’ instead of spaces, then it worked. Hope that helps
Yeah, I followed those steps too. My ENV file contains CLIENT_ID, CLIENT_SECRET, GRAPH_URL_SEGMENT, NODE_ENV, PORT, and SCOPE, all set to the values from the AD registration. However, the manual does not mention the Credential Manager anywhere. Additionally, there is no (straightforward) way to add Web Credentials in Windows 10 apparently.