aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Server.Implementations/Connect/ConnectManager.cs')
-rw-r--r--MediaBrowser.Server.Implementations/Connect/ConnectManager.cs23
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)
+ {
+ }
+ }
}
}