Initializing the Live Connect SDK

Before you can call any of the services available from the Live Connect API, you must first initialize your connection. You initialize your connection by calling the WL.init() method as illustrated in Listing 14.1.

LISTING 14.1 Initializing Your Connection

var REDIRECT_DOMAIN = "http://liveSDKDemo.Superexpert.com";var scopes = ["wl.signin"];WL.init({    scope: scopes,    redirect_uri: REDIRECT_DOMAIN});

The WL.init() method in Listing 14.1 is called with two arguments: a redirect_uri and an array of scopes. The redirect_uri must match (exactly) the Redirect Domain that you configured in the previous section. I discuss the array of scopes in the next section.

Get Windows® 8.1 Apps with HTML5 and JavaScript Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.