0

So I am writing an application in Node-Webkit/NW.js that needs a "Login to LinkedIn" button. We have to use a custom protocol/domain in order to allow hooking into the Dropbox API (let's call it app://example).

In the Application Details on the developer portal, for JavaScript API Domains I have "app://example" and "example." However, when I attempt to use my API key inside the application I get the following error:

Uncaught Error: JavaScript API Domain is restricted to example

Does LinkedIn not allow custom protocols, and only http/https? This is a big problem for us and I hope someone is able to answer.

Paul Sweatte
  • 24,148
  • 7
  • 127
  • 265
Josh Dean
  • 36
  • 2
  • I don't don't if "bump"s are a thing in StackOverflow...but getting an answer from someone who works at LinkedIn would be super helpful right now. Or a contact number to call them. – Josh Dean Mar 23 '15 at 22:02

1 Answers1

0

Use a server in a controlled environment rather than the developer console to avoid this error.

Use a redirect from the https:// protocol to the app:// protocol in that controlled environment. Here is the process:

Essentially, where I was previously seeing "Not allowed to load local resource: app://whatever/somefile.html", addOriginAccessWhitelistEntry eliminates the error and I see the appropriate app:// resource in the address bar with the following new error in the console: "Uncaught ReferenceError: require is not defined"

That said, if I force a refresh at this point the resource rendering occurs as expected.

 nw.App.addOriginAccessWhitelistEntry('http://github.com/', 'app', 'myapp', true);

References

Community
  • 1
  • 1
Paul Sweatte
  • 24,148
  • 7
  • 127
  • 265