locked
Live Services

    Question

  • Hi

    I`m trying to add some Live services to my code, and the code is:

    <!DOCTYPE html>
    <html>
    <head>
        <meta charset="utf-8">
        <title>JavaScript Code Sample</title>
        <!-- WinJS references -->
        <link href="//Microsoft.WinJS.1.0.RC/css/ui-dark.css" rel="stylesheet" />
        <script src="//Microsoft.WinJS.1.0.RC/js/base.js"></script>
        <script src="//Microsoft.WinJS.1.0.RC/js/ui.js"></script>
        <!-- JavaScript Code Sample references -->
        <link href="/css/default.css" rel="stylesheet">
        <script src="/js/default.js"></script>
        <!-- Developer-defined references -->
        <script src="///LiveSDKHTML/js/wl.js"></script>
    </head>
    <body>
        <h1>JavaScript Code Sample</h1>
        <div id="signin"></div>
        <label id="info"></label>
        <script>
            WL.Event.subscribe("auth.login", onLogin);
            WL.init({
                scope: ["wl.signin", "wl.basic"]
            });
            WL.ui({
                name: "signin",
                element: "signin"
            });
            function onLogin() {
                WL.api({
                    path: "me",
                    method: "GET"
                }).then(
                    function (response) {
                        document.getElementById("info").innerText =
                            "Hello, " + response.first_name + " " + response.last_name + "!";
                    },
                    function (responseFailed) {
                        document.getElementById("info").innerText =
                            "Error calling API: " + responseFailed.error.message;
                    }
                );
            }
        </script>
    </body>
    </html>
    

    The code throws me an error:

    The application requesting authentication tokens is either disabled or incorrectly configured.

    What is wrong here?

    The code above is a copy paste from here.

    I`ve read somewhere we need to start an app in my Live Account and I did and I got a clientID and all but

    I don`t see anywhere where I can use it.

    Any help will be great.

    Thanks

    Monday, August 13, 2012 1:40 PM

All replies

  • You need to review the working with code and core concepts documentation referenced on that page:

    http://msdn.microsoft.com/en-us/library/live/hh826552.aspx

    Will be a good start of how to use your client ID (that is what is missing).

    -Jeff


    Jeff Sanders (MSFT)

    Monday, August 13, 2012 4:05 PM
    Moderator
  • Hi Jeff

    If you are refering to this code:

    WL.init({
                    client_id: APP_CLIENT_ID,
                    redirect_uri: REDIRECT_URL,
                    scope: "wl.signin", 
                    response_type: "token"
                });

    I`ve tried it as well even though my app is windows 8 and not a web site.

    I entered there my client ID and an empty redirect url (as again this is a windows 8 app and I don`t want to navigate anywhere else).

    It didn`t work.

    Do have a sample working solution? maybe I`ll notice my problem.

    Thanks

    Monday, August 13, 2012 6:11 PM