aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Server.Implementations/Security
diff options
context:
space:
mode:
authorClaus Vium <cvium@users.noreply.github.com>2022-10-07 09:57:16 +0200
committerGitHub <noreply@github.com>2022-10-07 09:57:16 +0200
commit81b04ddbb54201d2e07310e3c700cca8a94d8955 (patch)
treea4e9aeb70e35b3e47a7d8af17b328e88a1c77ed0 /Jellyfin.Server.Implementations/Security
parent6bf71c0fd355e9c95a1e142019d9bc5cce34200d (diff)
parent14027f962ce074623fd89967ca9565bbeb785066 (diff)
Merge branch 'master' into providermanager-cleanup
Diffstat (limited to 'Jellyfin.Server.Implementations/Security')
-rw-r--r--Jellyfin.Server.Implementations/Security/AuthorizationContext.cs14
1 files changed, 10 insertions, 4 deletions
diff --git a/Jellyfin.Server.Implementations/Security/AuthorizationContext.cs b/Jellyfin.Server.Implementations/Security/AuthorizationContext.cs
index d59d36e88..9f813f532 100644
--- a/Jellyfin.Server.Implementations/Security/AuthorizationContext.cs
+++ b/Jellyfin.Server.Implementations/Security/AuthorizationContext.cs
@@ -4,6 +4,7 @@ using System;
using System.Collections.Generic;
using System.Net;
using System.Threading.Tasks;
+using MediaBrowser.Controller;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Net;
using Microsoft.AspNetCore.Http;
@@ -16,11 +17,16 @@ namespace Jellyfin.Server.Implementations.Security
{
private readonly JellyfinDbProvider _jellyfinDbProvider;
private readonly IUserManager _userManager;
+ private readonly IServerApplicationHost _serverApplicationHost;
- public AuthorizationContext(JellyfinDbProvider jellyfinDb, IUserManager userManager)
+ public AuthorizationContext(
+ JellyfinDbProvider jellyfinDb,
+ IUserManager userManager,
+ IServerApplicationHost serverApplicationHost)
{
_jellyfinDbProvider = jellyfinDb;
_userManager = userManager;
+ _serverApplicationHost = serverApplicationHost;
}
public Task<AuthorizationInfo> GetAuthorizationInfo(HttpContext requestContext)
@@ -187,17 +193,17 @@ namespace Jellyfin.Server.Implementations.Security
authInfo.Token = key.AccessToken;
if (string.IsNullOrWhiteSpace(authInfo.DeviceId))
{
- authInfo.DeviceId = string.Empty;
+ authInfo.DeviceId = _serverApplicationHost.SystemId;
}
if (string.IsNullOrWhiteSpace(authInfo.Device))
{
- authInfo.Device = string.Empty;
+ authInfo.Device = _serverApplicationHost.Name;
}
if (string.IsNullOrWhiteSpace(authInfo.Version))
{
- authInfo.Version = string.Empty;
+ authInfo.Version = _serverApplicationHost.ApplicationVersionString;
}
authInfo.IsApiKey = true;