aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2015-03-17 11:57:06 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2015-03-17 11:57:06 -0400
commitd9d295251cb7ff95173e81db55408adc8de17eab (patch)
tree76ae751bd3d2c3150d034dc3bcf2f27bc00218af /MediaBrowser.Server.Implementations/Connect/ConnectManager.cs
parent8b89d0b020c5cf060158007ba55d4dd4d62e0ebf (diff)
support adding connect user
Diffstat (limited to 'MediaBrowser.Server.Implementations/Connect/ConnectManager.cs')
-rw-r--r--MediaBrowser.Server.Implementations/Connect/ConnectManager.cs28
1 files changed, 28 insertions, 0 deletions
diff --git a/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs b/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs
index ac8ce7638..be0b32548 100644
--- a/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs
+++ b/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs
@@ -1085,6 +1085,34 @@ namespace MediaBrowser.Server.Implementations.Connect
}
}
+ public async Task AddConnectSupporter(string id)
+ {
+ if (!_securityManager.IsMBSupporter)
+ {
+ throw new InvalidOperationException();
+ }
+
+ var url = GetConnectUrl("keyAssociation");
+
+ url += "?serverId=" + ConnectServerId;
+ url += "&supporterKey=" + _securityManager.SupporterKey;
+ url += "&userId=" + id;
+
+ var options = new HttpRequestOptions
+ {
+ Url = url,
+ CancellationToken = CancellationToken.None
+ };
+
+ SetServerAccessToken(options);
+ SetApplicationHeader(options);
+
+ // No need to examine the response
+ using (var stream = (await _httpClient.SendAsync(options, "POST").ConfigureAwait(false)).Content)
+ {
+ }
+ }
+
public async Task RemoveConnectSupporter(string id)
{
if (!_securityManager.IsMBSupporter)