diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2015-02-06 22:25:23 -0500 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2015-02-06 22:25:23 -0500 |
| commit | 504e2099e2f11203c48dff94a67ec797a454d459 (patch) | |
| tree | 5371a9339be0530ed5e17988251c91a2dc030ee2 /MediaBrowser.Server.Implementations/HttpServer/Security/AuthService.cs | |
| parent | 7320567b9eb9179fabebf918df226a187ae2d55f (diff) | |
update dlna profiles
Diffstat (limited to 'MediaBrowser.Server.Implementations/HttpServer/Security/AuthService.cs')
| -rw-r--r-- | MediaBrowser.Server.Implementations/HttpServer/Security/AuthService.cs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/MediaBrowser.Server.Implementations/HttpServer/Security/AuthService.cs b/MediaBrowser.Server.Implementations/HttpServer/Security/AuthService.cs index 77953ee43..3903c62b1 100644 --- a/MediaBrowser.Server.Implementations/HttpServer/Security/AuthService.cs +++ b/MediaBrowser.Server.Implementations/HttpServer/Security/AuthService.cs @@ -74,7 +74,7 @@ namespace MediaBrowser.Server.Implementations.HttpServer.Security ValidateUserAccess(user, request, authAttribtues, auth); } - var info = (AuthenticationInfo)request.Items["OriginalAuthenticationInfo"]; + var info = GetTokenInfo(request); if (!IsExemptFromRoles(auth, authAttribtues, info)) { @@ -199,6 +199,13 @@ namespace MediaBrowser.Server.Implementations.HttpServer.Security } } + private AuthenticationInfo GetTokenInfo(IServiceRequest request) + { + object info; + request.Items.TryGetValue("OriginalAuthenticationInfo", out info); + return info as AuthenticationInfo; + } + private bool IsValidConnectKey(string token) { if (string.IsNullOrEmpty(token)) @@ -216,7 +223,7 @@ namespace MediaBrowser.Server.Implementations.HttpServer.Security throw new SecurityException("Access token is invalid or expired."); } - var info = (AuthenticationInfo)request.Items["OriginalAuthenticationInfo"]; + var info = GetTokenInfo(request); if (info == null) { |
