Wordpress Rest API login
<p>I am using the Wordpress Rest API on my WinJS Universalapplication and would like to somehow login my users before I let them browse products which I also get from the API.</p>

<p>I have tried something like this</p>

<pre><code>var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://example.com/wp-json/users/me",
    "method": "GET",
    "headers": {
        "authorization": "Basic dXNlcm5hbWU6cGFzc3dvcmQ==",
        "cache-control": "no-cache"
    }
}

$.ajax(settings).done(function(response) {
    console.log(response);
});
</code></pre>

<p>But I get </p>

<pre><code>DENIED - The requested resource requires user authentication. (XHR): GET - http://example.com/wp-json/users/me
</code></pre>

<p>I have also tried it using Postman and got this back</p>

<pre><code>[{"code":"json_not_logged_in","message":"You are not currently logged in."}]
</code></pre>

<p>I am not really sure what I am doing wrong since I am trying to log in with a username/password combination which is in the Users list in Wordpress.</p>

<p>UPDATE:</p>

<p>After installing a <a href="http://dev.semgeeks.com:9999/aceto-catalog/wp-admin/plugin-install.php?tab=plugin-information&amp;plugin=wp-basic-auth&amp;TB_iframe=true&amp;width=600&amp;height=550" rel="nofollow">basic authentication plugin</a> I am now able to get the it working but now when I enter a wrong username or password Windows 10 jumps in and opens its own login form instead of letting me handle it.</p>

<p>I'll have to figure out now how to supress this behaviour</p>