Search code examples
facebookwinjs

Facebook login WinJS Store app issues


I tried following this blog post Which explains how to setup up facebook login on a WinJS app.

I got it all working, got the app ids set and the authentication dialog is showing the correct app name and authentication stuff, however when the app redirects the app receives this error (after closing the dialog: "The specified protocol is unknown") and the dialog shows the error message: "We can't connect to the service you need right now. Check your network connection or try this again later".

the error stack:

"WinRTError: The specified protocol is unknown.\r\n\n   at getResultsOfAsyncOp (Function code:338:5)\n   at op.completed (Function code:427:21)

Actual calling code:

var loginURL = "https://www.facebook.com/dialog/oauth?client_id=[snip]&display=popup&scope=user_about_me&response_type=token&redirect_uri=ms-app://s-[snip]/"
                    Windows.Security.Authentication.Web.WebAuthenticationBroker.authenticateAsync(
                        Windows.Security.Authentication.Web.WebAuthenticationOptions.none,
                            new Windows.Foundation.Uri(loginURL))
                            .then(function success(result) {

                            }, function error(error) {

                            });

Hopefully anyone here has any idea why this error message is thrown.


Solution

  • We managed to solve the issue.

    The sid from the store was different from the sid of the app during local debugging. By changing the appmanifest -> packaging -> publisher certificate to a local certificate with the CN provided in the store settings the sid is updated to be equal to the one in the store.

    et voila, it works.