create user info from exchange token

This commit is contained in:
Luke Pulverenti
2015-04-03 20:41:16 -04:00
parent 4655a60d29
commit 4f7a69f368
4 changed files with 33 additions and 5 deletions

View File

@@ -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))