update connect methods

This commit is contained in:
Luke Pulverenti
2014-10-17 00:52:41 -04:00
parent 6ca771cc79
commit 4f207c43dd
17 changed files with 158 additions and 15 deletions

View File

@@ -1,4 +1,6 @@
using MediaBrowser.Common.Configuration;
using System.Security.Cryptography;
using MediaBrowser.Common.Configuration;
using MediaBrowser.Common.Extensions;
using MediaBrowser.Common.Net;
using MediaBrowser.Controller;
using MediaBrowser.Controller.Configuration;
@@ -825,5 +827,24 @@ namespace MediaBrowser.Server.Implementations.Connect
_logger.Debug("Connect returned a 404 when removing a user auth link. Handling it.");
}
}
public async Task Authenticate(string username, string passwordMd5)
{
var request = new HttpRequestOptions
{
Url = GetConnectUrl("user/authenticate")
};
request.SetPostData(new Dictionary<string, string>
{
{"userName",username},
{"password",passwordMd5}
});
// No need to examine the response
using (var stream = (await _httpClient.SendAsync(request, "POST").ConfigureAwait(false)).Content)
{
}
}
}
}