From d9d295251cb7ff95173e81db55408adc8de17eab Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Tue, 17 Mar 2015 11:57:06 -0400 Subject: support adding connect user --- .../Connect/ConnectManager.cs | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'MediaBrowser.Server.Implementations/Connect') diff --git a/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs b/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs index ac8ce7638e..be0b325487 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) -- cgit v1.2.3