Skip to content
This repository has been archived by the owner on Jun 25, 2021. It is now read-only.

getAccessTokenAsync give me 5013 error in Windows 10 #4

Closed
Danwakeem opened this issue Nov 29, 2017 · 11 comments
Closed

getAccessTokenAsync give me 5013 error in Windows 10 #4

Danwakeem opened this issue Nov 29, 2017 · 11 comments

Comments

@Danwakeem
Copy link

Hey there I used this repository to better understand how to set up SSO for a Excel application and I am running across a strange issue.

I got this project working locally on my Mac and then pushed the code for the server and the client side add in to a cloud platform. Then I modified the manifest file to point to the application I have running in the cloud.

With the modified manifest file on my mac everything works fine. I am connecting to this application I have running the cloud and I am able to successfully login via SSO in Excel.

But this is the strange part, when I copied the manifest file that is pointing to my cloud app to a Windows 10 computer and side loaded the manifest file it give me an error when I call getAccessTokenAsync. This is what the result object looks like when I am running the add in on my Windows 10 machine.

{
  "status":"failed",
  "error":{
    "name":"API Call Failed",
    "message":"Invalid input arguments.",
    "code":5013
  }
} 

Since this app is running the cloud I am passing the same input arguments on both the Mac and Windows version (({forceConsent: false}, callback)). I am not sure why it would work on my Mac but not on my Windows 10 machine. I also can't seem to find what exactly this error code is supposed to mean.

Do you know if I need to add something special to the manifest file for the Windows 10 configuration?

@Rick-Kirkham
Copy link
Contributor

The same manifest should work everywhere. (Although some manifests cannot be deployed through a SharePoint catalog.) When you sideload on Windows, what kind of catalog are you using?

@Danwakeem
Copy link
Author

I am not sure I just followed the instructions to make a shared folder on my computer the adding that in the trusted add ins section. I followed the instructions here

@Rick-Kirkham
Copy link
Contributor

OK. That means you are using a NetworkShare catalog, which should be fine. I'll see if I can find out anything.

@Danwakeem
Copy link
Author

Ahh okay, thank you so much for helping!

@Rick-Kirkham
Copy link
Contributor

Rick-Kirkham commented Nov 30, 2017

While we're waiting to hear back from the experts, a couple of thoughts:

  1. The errors that are specific to get AccessTokenAsync are number 13xxx. Error numbers 5xxx are from deeper in the Office.js code.
  2. The JavaScript engine that Office.js runs in on Windows is the version in IE 11 called Chakra. On a Mac the engine is the one in Safari called JavaScriptCore. Your error is "Invalid input arguments". Your first argument is the option object and it looks OK. The second is the callback. Could it be that you are using new JavaScript syntax (from ES6 or ES7) in the callback that is understood by JavaScriptCore, but not by Chakra?

@Danwakeem
Copy link
Author

Danwakeem commented Nov 30, 2017

Yeah I had seen that about the status codes. It was strange though because even on some of the other status code pages I could find the 5013 code.

The callback function is es5 syntax. Here is the first part of the function I made.

var callback = function(result) {
   console.log(result);
   ...
}

@Danwakeem
Copy link
Author

Danwakeem commented Nov 30, 2017

Is it possible the version of Excel I have is not compatible? The version of Excel I have for Windows 10 is 2016 version 1705.

Edit: Add it looks like this might be the case. This web page ways you have to have 1708 or later.

@Rick-Kirkham
Copy link
Contributor

@Danwakeem
One of our engineers just sent that same suggestion: Upgrade to 1708 8528.1000 or later.

@Danwakeem
Copy link
Author

Danwakeem commented Nov 30, 2017

Do you know if that build of Excel released yet? When I download Excel from our client's Office 365 management page it only gives me version 1705?

Edit: Sorry, I clearly need to read before commenting. I see on this page that I am probably just getting my build from a deferred channel. Let me try and install from a non deferred channel and see if that works.

@Rick-Kirkham
Copy link
Contributor

You many need to be an Office Insider to obtain this version. For more information, see Be an Office Insider .

@Danwakeem
Copy link
Author

It does appear that my Excel version was the issue. Another company we work with has Office 365 Business Premium and when I uninstalled Office then reinstalled with the Business Premium version it gave me version 1710 and when I ran my plugin with that version of Excel SSO worked just fine.

Kind of a bummer though. I definitly should have read the documentation more carefully before I implemented this feature. I guess I just believed the office 365 page when it said Pro Plus users would have access to the newest versions of Office. ¯\(ツ)

I do really appreciate your help though! This repository was super helpful in understanding how SSO works and how to implement it in the newer version of Office. I am hopping I will be able to use it in the future.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants