question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SSO Example fails with UnhandledPromiseRejection

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:46 (14 by maintainers)

github_iconTop GitHub Comments

3reactions
Haaxor1689commented, Feb 8, 2022

For anyone that wants to use .env file 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.

require('dotenv').config();
const { execSync } = require('child_process');
const { userInfo } = require('os');

const path = 'node_modules/office-addin-sso/lib/scripts/addAppSecret.ps1';
const appName = 'YOUR_APP_NAME';
const user = userInfo().username;
const secret = process.env.CLIENT_SECRET;

execSync(
  `powershell -ExecutionPolicy Bypass -File "${path}" "${appName}" "${user}" "${secret}"`,
  { stdio: 'pipe' }
);

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:

"secret:add": "node ./addAppSecret.js"
2reactions
andrewconnellcommented, Apr 30, 2021

@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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: cant set headers after they are sent - Stack Overflow
This error means that you are trying to send a response after a response has already been sent. I think this will fix...
Read more >
Unable to run samples-nodejs-express-4 - Okta Support
Hi there, Just started with Okta to evaluate the product, but unable to run anything from the samples-example bundle mentioned above.
Read more >
Troubleshoot Azure Active Directory Seamless Single Sign-On
In this article. Known issues; Check status of feature; Sign-in failure reasons in the Azure Active Directory admin center (needs a Premium ...
Read more >
Tracking Unhandled Promise Rejections - TrackJS
This is a simple example, so catching the rejection is trivial. As promise chains grow larger, it gets more challenging to reason about...
Read more >
Possible Unhandled Promise Rejection with an android ...
Coding example for the question Possible Unhandled Promise Rejection with an ... But if any error occurred, your application will crash as you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found