mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-21 17:44:43 +01:00
create user info from exchange token
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user