aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/HttpServer/Security/AuthService.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2014-10-18 15:02:54 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2014-10-18 15:02:54 -0400
commitf1a602f5a87f666eec03b9afd3f3edfa27d337f6 (patch)
tree25cca82b4b125104654282ebdc47814d6f322349 /MediaBrowser.Server.Implementations/HttpServer/Security/AuthService.cs
parent76cabe82269ff92d5950b8cf738c00976ca60e93 (diff)
disable nuget package restore
Diffstat (limited to 'MediaBrowser.Server.Implementations/HttpServer/Security/AuthService.cs')
-rw-r--r--MediaBrowser.Server.Implementations/HttpServer/Security/AuthService.cs15
1 files changed, 14 insertions, 1 deletions
diff --git a/MediaBrowser.Server.Implementations/HttpServer/Security/AuthService.cs b/MediaBrowser.Server.Implementations/HttpServer/Security/AuthService.cs
index e5a94d5cb..a1a68586b 100644
--- a/MediaBrowser.Server.Implementations/HttpServer/Security/AuthService.cs
+++ b/MediaBrowser.Server.Implementations/HttpServer/Security/AuthService.cs
@@ -68,7 +68,10 @@ namespace MediaBrowser.Server.Implementations.HttpServer.Security
if (!string.IsNullOrWhiteSpace(auth.Token) ||
!_config.Configuration.InsecureApps2.Contains(auth.Client ?? string.Empty, StringComparer.OrdinalIgnoreCase))
{
- SessionManager.ValidateSecurityToken(auth.Token);
+ if (!IsValidConnectKey(auth.Token))
+ {
+ SessionManager.ValidateSecurityToken(auth.Token);
+ }
}
}
@@ -115,6 +118,16 @@ namespace MediaBrowser.Server.Implementations.HttpServer.Security
}
}
+ private bool IsValidConnectKey(string token)
+ {
+ if (!string.IsNullOrEmpty(token))
+ {
+ return UserManager.Users.Any(u => string.Equals(token, u.ConnectAccessKey, StringComparison.OrdinalIgnoreCase) && !string.IsNullOrEmpty(u.ConnectAccessKey));
+ }
+
+ return false;
+ }
+
protected bool DoHtmlRedirectIfConfigured(IRequest req, IResponse res, bool includeRedirectParam = false)
{
var htmlRedirect = this.HtmlRedirect ?? AuthenticateService.HtmlRedirect;