1
votes

I have followed the instructions from here and registered an app via azure to test this Sample:

  1. Register an application with the Microsoft Identity Platform
  • visit https://portal.azure.com/
  • login with excel 365 acc
  • [click ] on top left hand hamburger
  • [select] - Azure Active Directory
  • [scroll] to bottom of page to see icon - App registration
  • [click] App registration
  • [type name] Sample-Office-Add-in-Microsoft-Graph-React
  • [select] - Accounts in any organizational directory
  • [keep] - Web
  • [type - redirect uri] https://localhost:3000/login/login.html
  • [click] - register
  1. Copy client id to put into login/login.ts
  • [copy] Client ID
  • [paste] login/login.ts clientId
  1. certs - https://github.com/OfficeDev/generator-office/blob/master/src/docs/ssl.md#method-2-manually-install-the-certificate
  • cd to certs folder
cd Office-Add-in-Microsoft-Graph-React\certs
  • [Dbl click] - ca.crt
  • [click] Install certificate
  • [Select] Local Machine
  • [Select] Place all certificates in the following store
  • [click] browse
  • [Select] Trusted Root Certification Authorities
  • [click] ok
  • [click] next
  • [click] Finish
The import was successful

You now have a self-signed certificate installed on your machine.

  1. run cmd as administrator: run node application
yarn start
  • Note: Did not opwn separate cmd window. Stayed in same.
  1. Open new cmd terminal - run sideload
yarn run sideload
  1. in excel [click] - Open Add-in
  2. [click - button] Connect to Office 365

errorMessage: login_progress_error message: Login_In_Progress: Error during login call - login is already in progress. errorCode: ClientAuthError: Login_In_Progress: Error during login call - login is already in progress. at AuthError (eval code:26:9) at ClientAuthError (eval code:106:9) at ClientAuthError.createLoginInProgressError (eval code:143:9) at UserAgentApplication.prototype.acquireTokenInteractive (eval code:333:13) at UserAgentApplication.prototype.loginRedirect (eval code:246:9) at Office.initialize (eval code:50:13) at Anonymous function (https://appsforoffice.microsoft.com/lib/1.1/hosted/office.debug.js:1782:41) at validateFunction (https://appsforoffice.microsoft.com/lib/1.1/hosted/office.debug.js:306:21) at LoadScriptHelper.prototype.waitForFunction (https://appsforoffice.microsoft.com/lib/1.1/hosted/office.debug.js:318:13) at appReady (https://appsforoffice.microsoft.com/lib/1.1/hosted/office.debug.js:1778:25) .

I have looked in the other stackoverflow questions and github, and there is not a solution to this problem. Any advice.

I will post this in github also.

1
I went through your instructions exactly and mine ran fine with one exception, I had to allow the implicit grant options Access tokens and ID tokens. I didn't see this in your instructions, did you do that? It's under the Authentication tab on the Left Nav in the App on portal.azure.com. Another note, on my production app I had to change <script type="text/javascript" src="https://appsforoffice.microsoft.com/lib/1.1/hosted/office.debug.js"></script> to <script type="text/javascript" src="https://appsforoffice.microsoft.com/lib/1.1/hosted/office.js"></script> - nikolifish
@nikolifish Oh my god. Thankyou so much. It now works - mostly with removing .debug from path. This has been a bane in my side. Please post an answer to this and I'll upvote you more. - Steve Tomlin

1 Answers

0
votes

Try changing script type="text/javascript" src="https://appsforoffice.microsoft.com/lib/1.1/hosted/office.debug.js"></script> from the git example to the production url <script type="text/javascript" src="https://appsforoffice.microsoft.com/lib/1.1/hosted/office.js"></script> in your Login.html page. You will likely have to do this in your logout.html page as well