diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-10-17 00:52:41 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-10-17 00:52:41 -0400 |
| commit | 4f207c43dd912b710345e083adfb6ad45c849b1d (patch) | |
| tree | 56d9e71f10ba8b5f67fee39b846f6ebf2123f6a3 /MediaBrowser.Server.Implementations/Connect/ConnectManager.cs | |
| parent | 6ca771cc7906ae6524f737ae9bf0bc1b916efb40 (diff) | |
update connect methods
Diffstat (limited to 'MediaBrowser.Server.Implementations/Connect/ConnectManager.cs')
| -rw-r--r-- | MediaBrowser.Server.Implementations/Connect/ConnectManager.cs | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs b/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs index e3d4b600c..f1a9601cb 100644 --- a/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs +++ b/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs @@ -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) + { + } + } } } |
