aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/Connect
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2015-04-03 20:41:16 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2015-04-03 20:41:16 -0400
commit4f7a69f3689c6aeba6021629818e4e3cced17475 (patch)
tree70e37c2952e2cb648659275ec27c0e127388ddc4 /MediaBrowser.Server.Implementations/Connect
parent4655a60d2992b2bb674dda783fbaeb5fba48918f (diff)
create user info from exchange token
Diffstat (limited to 'MediaBrowser.Server.Implementations/Connect')
-rw-r--r--MediaBrowser.Server.Implementations/Connect/ConnectManager.cs12
1 files changed, 11 insertions, 1 deletions
diff --git a/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs b/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs
index a7f8717a7..b1b6cd899 100644
--- a/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs
+++ b/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs
@@ -1125,7 +1125,7 @@ namespace MediaBrowser.Server.Implementations.Connect
url += "?serverId=" + ConnectServerId;
url += "&supporterKey=" + _securityManager.SupporterKey;
url += "&userId=" + id;
-
+
var options = new HttpRequestOptions
{
Url = url,
@@ -1244,6 +1244,16 @@ namespace MediaBrowser.Server.Implementations.Connect
.FirstOrDefault(i => string.Equals(i.ConnectUserId, connectUserId, StringComparison.OrdinalIgnoreCase));
}
+ public User GetUserFromExchangeToken(string token)
+ {
+ if (string.IsNullOrWhiteSpace(token))
+ {
+ throw new ArgumentNullException("token");
+ }
+
+ return _userManager.Users.FirstOrDefault(u => string.Equals(token, u.ConnectAccessKey, StringComparison.OrdinalIgnoreCase));
+ }
+
public bool IsAuthorizationTokenValid(string token)
{
if (string.IsNullOrWhiteSpace(token))