2019-11-01 17:38:54 +00:00
|
|
|
#pragma warning disable CS1591
|
|
|
|
|
2014-11-15 02:31:03 +00:00
|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
2019-09-02 06:19:29 +00:00
|
|
|
using System.Net;
|
2021-05-21 03:56:59 +00:00
|
|
|
using System.Threading.Tasks;
|
2022-05-21 02:49:25 +00:00
|
|
|
using MediaBrowser.Controller;
|
2018-09-12 17:26:21 +00:00
|
|
|
using MediaBrowser.Controller.Library;
|
2019-01-13 19:20:41 +00:00
|
|
|
using MediaBrowser.Controller.Net;
|
2020-06-15 19:21:18 +00:00
|
|
|
using Microsoft.AspNetCore.Http;
|
2021-10-04 13:43:40 +00:00
|
|
|
using Microsoft.EntityFrameworkCore;
|
2019-03-05 18:20:28 +00:00
|
|
|
using Microsoft.Net.Http.Headers;
|
2014-07-02 04:57:18 +00:00
|
|
|
|
2021-05-21 03:56:59 +00:00
|
|
|
namespace Jellyfin.Server.Implementations.Security
|
2014-07-02 04:57:18 +00:00
|
|
|
{
|
|
|
|
public class AuthorizationContext : IAuthorizationContext
|
|
|
|
{
|
2021-06-18 21:06:38 +00:00
|
|
|
private readonly JellyfinDbProvider _jellyfinDbProvider;
|
2018-09-12 17:26:21 +00:00
|
|
|
private readonly IUserManager _userManager;
|
2022-05-21 02:49:25 +00:00
|
|
|
private readonly IServerApplicationHost _serverApplicationHost;
|
2014-11-15 02:31:03 +00:00
|
|
|
|
2022-05-21 02:49:25 +00:00
|
|
|
public AuthorizationContext(
|
|
|
|
JellyfinDbProvider jellyfinDb,
|
|
|
|
IUserManager userManager,
|
|
|
|
IServerApplicationHost serverApplicationHost)
|
2014-11-15 02:31:03 +00:00
|
|
|
{
|
2021-06-18 21:06:38 +00:00
|
|
|
_jellyfinDbProvider = jellyfinDb;
|
2018-09-12 17:26:21 +00:00
|
|
|
_userManager = userManager;
|
2022-05-21 02:49:25 +00:00
|
|
|
_serverApplicationHost = serverApplicationHost;
|
2014-11-15 02:31:03 +00:00
|
|
|
}
|
|
|
|
|
2021-05-21 03:56:59 +00:00
|
|
|
public Task<AuthorizationInfo> GetAuthorizationInfo(HttpContext requestContext)
|
2014-11-15 02:31:03 +00:00
|
|
|
{
|
2021-05-21 03:56:59 +00:00
|
|
|
if (requestContext.Request.HttpContext.Items.TryGetValue("AuthorizationInfo", out var cached) && cached != null)
|
2014-11-15 02:31:03 +00:00
|
|
|
{
|
2021-10-03 03:43:05 +00:00
|
|
|
return Task.FromResult((AuthorizationInfo)cached); // Cache should never contain null
|
2014-11-15 02:31:03 +00:00
|
|
|
}
|
|
|
|
|
2014-07-02 04:57:18 +00:00
|
|
|
return GetAuthorization(requestContext);
|
|
|
|
}
|
|
|
|
|
2021-05-21 03:56:59 +00:00
|
|
|
public async Task<AuthorizationInfo> GetAuthorizationInfo(HttpRequest requestContext)
|
2020-06-15 19:21:18 +00:00
|
|
|
{
|
|
|
|
var auth = GetAuthorizationDictionary(requestContext);
|
2021-05-21 03:56:59 +00:00
|
|
|
var authInfo = await GetAuthorizationInfoFromDictionary(auth, requestContext.Headers, requestContext.Query).ConfigureAwait(false);
|
2020-06-15 19:21:18 +00:00
|
|
|
return authInfo;
|
|
|
|
}
|
|
|
|
|
2014-07-02 04:57:18 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Gets the authorization.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="httpReq">The HTTP req.</param>
|
|
|
|
/// <returns>Dictionary{System.StringSystem.String}.</returns>
|
2021-05-21 03:56:59 +00:00
|
|
|
private async Task<AuthorizationInfo> GetAuthorization(HttpContext httpReq)
|
2014-07-02 04:57:18 +00:00
|
|
|
{
|
|
|
|
var auth = GetAuthorizationDictionary(httpReq);
|
2021-05-21 03:56:59 +00:00
|
|
|
var authInfo = await GetAuthorizationInfoFromDictionary(auth, httpReq.Request.Headers, httpReq.Request.Query).ConfigureAwait(false);
|
2014-07-02 04:57:18 +00:00
|
|
|
|
2020-09-02 10:22:14 +00:00
|
|
|
httpReq.Request.HttpContext.Items["AuthorizationInfo"] = authInfo;
|
2020-06-15 19:21:18 +00:00
|
|
|
return authInfo;
|
|
|
|
}
|
|
|
|
|
2021-05-21 03:56:59 +00:00
|
|
|
private async Task<AuthorizationInfo> GetAuthorizationInfoFromDictionary(
|
|
|
|
IReadOnlyDictionary<string, string>? auth,
|
|
|
|
IHeaderDictionary headers,
|
|
|
|
IQueryCollection queryString)
|
2020-06-15 19:21:18 +00:00
|
|
|
{
|
2021-05-20 19:28:18 +00:00
|
|
|
string? deviceId = null;
|
2021-05-21 03:56:59 +00:00
|
|
|
string? deviceName = null;
|
2021-05-20 19:28:18 +00:00
|
|
|
string? client = null;
|
|
|
|
string? version = null;
|
|
|
|
string? token = null;
|
2014-07-02 04:57:18 +00:00
|
|
|
|
|
|
|
if (auth != null)
|
|
|
|
{
|
|
|
|
auth.TryGetValue("DeviceId", out deviceId);
|
2021-05-21 03:56:59 +00:00
|
|
|
auth.TryGetValue("Device", out deviceName);
|
2014-07-02 04:57:18 +00:00
|
|
|
auth.TryGetValue("Client", out client);
|
|
|
|
auth.TryGetValue("Version", out version);
|
2017-01-13 21:05:12 +00:00
|
|
|
auth.TryGetValue("Token", out token);
|
2014-07-02 04:57:18 +00:00
|
|
|
}
|
|
|
|
|
2021-08-28 22:32:50 +00:00
|
|
|
#pragma warning disable CA1508 // string.IsNullOrEmpty(token) is always false.
|
2020-06-15 19:21:18 +00:00
|
|
|
if (string.IsNullOrEmpty(token))
|
|
|
|
{
|
|
|
|
token = headers["X-Emby-Token"];
|
2017-01-13 21:05:12 +00:00
|
|
|
}
|
2014-07-04 02:22:57 +00:00
|
|
|
|
2018-09-12 17:26:21 +00:00
|
|
|
if (string.IsNullOrEmpty(token))
|
2015-10-04 22:04:56 +00:00
|
|
|
{
|
2020-06-15 19:21:18 +00:00
|
|
|
token = headers["X-MediaBrowser-Token"];
|
2015-10-04 22:04:56 +00:00
|
|
|
}
|
2020-06-15 19:21:18 +00:00
|
|
|
|
2018-09-12 17:26:21 +00:00
|
|
|
if (string.IsNullOrEmpty(token))
|
2014-07-04 02:22:57 +00:00
|
|
|
{
|
2020-06-15 19:21:18 +00:00
|
|
|
token = queryString["ApiKey"];
|
2014-07-04 02:22:57 +00:00
|
|
|
}
|
|
|
|
|
2020-06-16 22:45:17 +00:00
|
|
|
// TODO deprecate this query parameter.
|
2020-06-15 19:21:18 +00:00
|
|
|
if (string.IsNullOrEmpty(token))
|
|
|
|
{
|
|
|
|
token = queryString["api_key"];
|
|
|
|
}
|
|
|
|
|
|
|
|
var authInfo = new AuthorizationInfo
|
2014-07-02 04:57:18 +00:00
|
|
|
{
|
|
|
|
Client = client,
|
2021-05-21 03:56:59 +00:00
|
|
|
Device = deviceName,
|
2014-07-02 04:57:18 +00:00
|
|
|
DeviceId = deviceId,
|
2014-07-02 18:34:08 +00:00
|
|
|
Version = version,
|
2020-11-08 15:10:33 +00:00
|
|
|
Token = token,
|
2020-12-01 21:47:42 +00:00
|
|
|
IsAuthenticated = false,
|
|
|
|
HasToken = false
|
2014-07-02 04:57:18 +00:00
|
|
|
};
|
2014-11-15 02:31:03 +00:00
|
|
|
|
2020-10-14 23:58:33 +00:00
|
|
|
if (string.IsNullOrWhiteSpace(token))
|
2014-11-15 02:31:03 +00:00
|
|
|
{
|
2020-10-14 23:58:33 +00:00
|
|
|
// Request doesn't contain a token.
|
2020-11-08 15:10:33 +00:00
|
|
|
return authInfo;
|
2020-10-14 23:58:33 +00:00
|
|
|
}
|
2021-05-21 03:56:59 +00:00
|
|
|
#pragma warning restore CA1508
|
2014-11-15 02:31:03 +00:00
|
|
|
|
2020-12-01 21:47:42 +00:00
|
|
|
authInfo.HasToken = true;
|
2021-06-18 21:09:59 +00:00
|
|
|
await using var dbContext = _jellyfinDbProvider.CreateContext();
|
|
|
|
var device = await dbContext.Devices.FirstOrDefaultAsync(d => d.AccessToken == token).ConfigureAwait(false);
|
2014-11-15 02:31:03 +00:00
|
|
|
|
2021-05-21 03:56:59 +00:00
|
|
|
if (device != null)
|
2020-11-08 15:10:33 +00:00
|
|
|
{
|
|
|
|
authInfo.IsAuthenticated = true;
|
2020-10-14 23:58:33 +00:00
|
|
|
var updateToken = false;
|
2017-10-17 19:50:10 +00:00
|
|
|
|
2020-10-14 23:58:33 +00:00
|
|
|
// TODO: Remove these checks for IsNullOrWhiteSpace
|
|
|
|
if (string.IsNullOrWhiteSpace(authInfo.Client))
|
|
|
|
{
|
2021-05-21 03:56:59 +00:00
|
|
|
authInfo.Client = device.AppName;
|
2020-10-14 23:58:33 +00:00
|
|
|
}
|
2017-10-17 19:50:10 +00:00
|
|
|
|
2020-10-14 23:58:33 +00:00
|
|
|
if (string.IsNullOrWhiteSpace(authInfo.DeviceId))
|
|
|
|
{
|
2021-05-21 03:56:59 +00:00
|
|
|
authInfo.DeviceId = device.DeviceId;
|
2020-10-14 23:58:33 +00:00
|
|
|
}
|
2017-10-17 19:50:10 +00:00
|
|
|
|
2020-10-14 23:58:33 +00:00
|
|
|
// Temporary. TODO - allow clients to specify that the token has been shared with a casting device
|
2021-05-21 03:56:59 +00:00
|
|
|
var allowTokenInfoUpdate = !authInfo.Client.Contains("chromecast", StringComparison.OrdinalIgnoreCase);
|
2017-10-17 19:50:10 +00:00
|
|
|
|
2020-10-14 23:58:33 +00:00
|
|
|
if (string.IsNullOrWhiteSpace(authInfo.Device))
|
|
|
|
{
|
2021-05-21 03:56:59 +00:00
|
|
|
authInfo.Device = device.DeviceName;
|
2020-10-14 23:58:33 +00:00
|
|
|
}
|
2021-05-21 03:56:59 +00:00
|
|
|
else if (!string.Equals(authInfo.Device, device.DeviceName, StringComparison.OrdinalIgnoreCase))
|
2020-10-14 23:58:33 +00:00
|
|
|
{
|
|
|
|
if (allowTokenInfoUpdate)
|
2017-10-17 19:50:10 +00:00
|
|
|
{
|
2020-10-14 23:58:33 +00:00
|
|
|
updateToken = true;
|
2021-05-21 03:56:59 +00:00
|
|
|
device.DeviceName = authInfo.Device;
|
2018-09-12 17:26:21 +00:00
|
|
|
}
|
2020-10-14 23:58:33 +00:00
|
|
|
}
|
2018-09-12 17:26:21 +00:00
|
|
|
|
2020-10-14 23:58:33 +00:00
|
|
|
if (string.IsNullOrWhiteSpace(authInfo.Version))
|
|
|
|
{
|
2021-05-21 03:56:59 +00:00
|
|
|
authInfo.Version = device.AppVersion;
|
2020-10-14 23:58:33 +00:00
|
|
|
}
|
2021-05-21 03:56:59 +00:00
|
|
|
else if (!string.Equals(authInfo.Version, device.AppVersion, StringComparison.OrdinalIgnoreCase))
|
2020-10-14 23:58:33 +00:00
|
|
|
{
|
|
|
|
if (allowTokenInfoUpdate)
|
2018-09-12 17:26:21 +00:00
|
|
|
{
|
2017-10-17 19:50:10 +00:00
|
|
|
updateToken = true;
|
2021-05-21 03:56:59 +00:00
|
|
|
device.AppVersion = authInfo.Version;
|
2018-09-12 17:26:21 +00:00
|
|
|
}
|
2020-10-14 23:58:33 +00:00
|
|
|
}
|
2018-09-12 17:26:21 +00:00
|
|
|
|
2021-05-21 03:56:59 +00:00
|
|
|
if ((DateTime.UtcNow - device.DateLastActivity).TotalMinutes > 3)
|
2020-10-14 23:58:33 +00:00
|
|
|
{
|
2021-05-21 03:56:59 +00:00
|
|
|
device.DateLastActivity = DateTime.UtcNow;
|
2020-10-14 23:58:33 +00:00
|
|
|
updateToken = true;
|
|
|
|
}
|
2018-09-12 17:26:21 +00:00
|
|
|
|
2021-06-27 20:44:34 +00:00
|
|
|
authInfo.User = _userManager.GetUserById(device.UserId);
|
2017-10-17 19:50:10 +00:00
|
|
|
|
2020-10-14 23:58:33 +00:00
|
|
|
if (updateToken)
|
2020-10-28 14:40:11 +00:00
|
|
|
{
|
2021-06-18 21:09:59 +00:00
|
|
|
dbContext.Devices.Update(device);
|
|
|
|
await dbContext.SaveChangesAsync().ConfigureAwait(false);
|
2014-11-15 02:31:03 +00:00
|
|
|
}
|
|
|
|
}
|
2021-06-18 22:26:58 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
var key = await dbContext.ApiKeys.FirstOrDefaultAsync(apiKey => apiKey.AccessToken == token).ConfigureAwait(false);
|
|
|
|
if (key != null)
|
2020-10-14 23:58:33 +00:00
|
|
|
{
|
2021-06-18 22:26:58 +00:00
|
|
|
authInfo.IsAuthenticated = true;
|
|
|
|
authInfo.Client = key.Name;
|
|
|
|
authInfo.Token = key.AccessToken;
|
2021-11-12 21:23:58 +00:00
|
|
|
if (string.IsNullOrWhiteSpace(authInfo.DeviceId))
|
2021-11-11 05:43:43 +00:00
|
|
|
{
|
2022-05-21 02:49:25 +00:00
|
|
|
authInfo.DeviceId = _serverApplicationHost.SystemId;
|
2021-11-11 05:43:43 +00:00
|
|
|
}
|
|
|
|
|
2021-11-12 21:23:58 +00:00
|
|
|
if (string.IsNullOrWhiteSpace(authInfo.Device))
|
2021-11-11 05:43:43 +00:00
|
|
|
{
|
2022-05-21 02:49:25 +00:00
|
|
|
authInfo.Device = _serverApplicationHost.Name;
|
2021-11-11 05:43:43 +00:00
|
|
|
}
|
|
|
|
|
2021-11-12 21:23:58 +00:00
|
|
|
if (string.IsNullOrWhiteSpace(authInfo.Version))
|
2021-11-11 05:43:43 +00:00
|
|
|
{
|
2022-05-21 02:49:25 +00:00
|
|
|
authInfo.Version = _serverApplicationHost.ApplicationVersionString;
|
2021-11-11 05:43:43 +00:00
|
|
|
}
|
2021-11-11 16:03:27 +00:00
|
|
|
|
2021-06-27 20:44:34 +00:00
|
|
|
authInfo.IsApiKey = true;
|
2014-11-15 02:31:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-11-08 15:10:33 +00:00
|
|
|
return authInfo;
|
2014-07-02 04:57:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets the auth.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="httpReq">The HTTP req.</param>
|
|
|
|
/// <returns>Dictionary{System.StringSystem.String}.</returns>
|
2021-05-21 04:19:54 +00:00
|
|
|
private static Dictionary<string, string>? GetAuthorizationDictionary(HttpContext httpReq)
|
2014-07-02 04:57:18 +00:00
|
|
|
{
|
2020-09-02 10:22:14 +00:00
|
|
|
var auth = httpReq.Request.Headers["X-Emby-Authorization"];
|
2020-06-15 19:21:18 +00:00
|
|
|
|
|
|
|
if (string.IsNullOrEmpty(auth))
|
|
|
|
{
|
2020-09-02 10:22:14 +00:00
|
|
|
auth = httpReq.Request.Headers[HeaderNames.Authorization];
|
2020-06-15 19:21:18 +00:00
|
|
|
}
|
|
|
|
|
2021-05-21 04:09:11 +00:00
|
|
|
return auth.Count > 0 ? GetAuthorization(auth[0]) : null;
|
2020-06-15 19:21:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets the auth.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="httpReq">The HTTP req.</param>
|
|
|
|
/// <returns>Dictionary{System.StringSystem.String}.</returns>
|
2021-05-21 04:19:54 +00:00
|
|
|
private static Dictionary<string, string>? GetAuthorizationDictionary(HttpRequest httpReq)
|
2020-06-15 19:21:18 +00:00
|
|
|
{
|
2020-06-17 12:52:15 +00:00
|
|
|
var auth = httpReq.Headers["X-Emby-Authorization"];
|
2015-07-03 11:51:45 +00:00
|
|
|
|
2018-09-12 17:26:21 +00:00
|
|
|
if (string.IsNullOrEmpty(auth))
|
2015-07-03 11:51:45 +00:00
|
|
|
{
|
2019-03-05 18:20:28 +00:00
|
|
|
auth = httpReq.Headers[HeaderNames.Authorization];
|
2015-07-03 11:51:45 +00:00
|
|
|
}
|
2014-07-02 04:57:18 +00:00
|
|
|
|
2021-05-21 04:09:11 +00:00
|
|
|
return auth.Count > 0 ? GetAuthorization(auth[0]) : null;
|
2014-07-02 04:57:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets the authorization.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="authorizationHeader">The authorization header.</param>
|
|
|
|
/// <returns>Dictionary{System.StringSystem.String}.</returns>
|
2021-05-21 04:19:54 +00:00
|
|
|
private static Dictionary<string, string>? GetAuthorization(ReadOnlySpan<char> authorizationHeader)
|
2014-07-02 04:57:18 +00:00
|
|
|
{
|
2021-05-16 12:49:11 +00:00
|
|
|
var firstSpace = authorizationHeader.IndexOf(' ');
|
2014-07-02 04:57:18 +00:00
|
|
|
|
2021-05-16 12:49:11 +00:00
|
|
|
// There should be at least two parts
|
|
|
|
if (firstSpace == -1)
|
2019-09-02 06:19:29 +00:00
|
|
|
{
|
|
|
|
return null;
|
|
|
|
}
|
2014-07-02 04:57:18 +00:00
|
|
|
|
2021-05-16 12:49:11 +00:00
|
|
|
var name = authorizationHeader[..firstSpace];
|
2017-01-13 21:05:12 +00:00
|
|
|
|
2021-05-16 12:49:11 +00:00
|
|
|
if (!name.Equals("MediaBrowser", StringComparison.OrdinalIgnoreCase)
|
2021-05-16 13:27:31 +00:00
|
|
|
&& !name.Equals("Emby", StringComparison.OrdinalIgnoreCase))
|
2014-07-02 04:57:18 +00:00
|
|
|
{
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2021-02-26 14:30:00 +00:00
|
|
|
// Remove up until the first space
|
2021-06-03 15:37:42 +00:00
|
|
|
authorizationHeader = authorizationHeader[(firstSpace + 1)..];
|
2021-06-03 15:43:50 +00:00
|
|
|
return GetParts(authorizationHeader);
|
2020-12-14 13:05:53 +00:00
|
|
|
}
|
2020-12-15 20:01:42 +00:00
|
|
|
|
2020-12-15 20:06:47 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Get the authorization header components.
|
|
|
|
/// </summary>
|
2021-06-03 15:07:25 +00:00
|
|
|
/// <param name="authorizationHeader">The authorization header.</param>
|
2021-06-03 15:45:22 +00:00
|
|
|
/// <returns>Dictionary{System.StringSystem.String}.</returns>
|
2021-06-03 15:43:50 +00:00
|
|
|
public static Dictionary<string, string> GetParts(ReadOnlySpan<char> authorizationHeader)
|
2020-12-15 20:01:42 +00:00
|
|
|
{
|
2021-02-26 14:30:00 +00:00
|
|
|
var result = new Dictionary<string, string>();
|
2020-12-15 20:01:42 +00:00
|
|
|
var escaped = false;
|
2021-01-02 17:18:47 +00:00
|
|
|
int start = 0;
|
2021-02-26 14:30:00 +00:00
|
|
|
string key = string.Empty;
|
|
|
|
|
2021-06-03 15:10:19 +00:00
|
|
|
int i;
|
2021-06-03 15:12:16 +00:00
|
|
|
for (i = 0; i < authorizationHeader.Length; i++)
|
2020-12-15 20:01:42 +00:00
|
|
|
{
|
2021-06-03 15:12:16 +00:00
|
|
|
var token = authorizationHeader[i];
|
2021-06-03 15:10:19 +00:00
|
|
|
if (token == '"' || token == ',')
|
2020-12-15 20:01:42 +00:00
|
|
|
{
|
2021-01-02 17:18:47 +00:00
|
|
|
// Applying a XOR logic to evaluate whether it is opening or closing a value
|
|
|
|
escaped = (!escaped) == (token == '"');
|
|
|
|
if (token == ',' && !escaped)
|
2020-12-15 20:01:42 +00:00
|
|
|
{
|
2021-01-02 17:18:47 +00:00
|
|
|
// Meeting a comma after a closing escape char means the value is complete
|
|
|
|
if (start < i)
|
2020-12-15 20:01:42 +00:00
|
|
|
{
|
2021-06-03 15:43:50 +00:00
|
|
|
result[key] = WebUtility.UrlDecode(authorizationHeader[start..i].Trim('"').ToString());
|
2021-02-26 14:30:00 +00:00
|
|
|
key = string.Empty;
|
2020-12-15 20:01:42 +00:00
|
|
|
}
|
2021-01-02 17:18:47 +00:00
|
|
|
|
|
|
|
start = i + 1;
|
2020-12-15 20:01:42 +00:00
|
|
|
}
|
|
|
|
}
|
2021-02-26 14:30:00 +00:00
|
|
|
else if (!escaped && token == '=')
|
|
|
|
{
|
2021-09-03 21:56:19 +00:00
|
|
|
key = authorizationHeader[start.. i].Trim().ToString();
|
2021-02-26 14:30:00 +00:00
|
|
|
start = i + 1;
|
|
|
|
}
|
2020-12-15 20:01:42 +00:00
|
|
|
}
|
2021-01-02 17:18:47 +00:00
|
|
|
|
2020-12-15 20:01:42 +00:00
|
|
|
// Add last value
|
2021-01-02 17:18:47 +00:00
|
|
|
if (start < i)
|
|
|
|
{
|
2021-06-03 15:43:50 +00:00
|
|
|
result[key] = WebUtility.UrlDecode(authorizationHeader[start..i].Trim('"').ToString());
|
2021-01-02 17:18:47 +00:00
|
|
|
}
|
2020-12-15 20:01:42 +00:00
|
|
|
|
2021-02-26 14:30:00 +00:00
|
|
|
return result;
|
2020-12-15 20:01:42 +00:00
|
|
|
}
|
2014-07-02 04:57:18 +00:00
|
|
|
}
|
|
|
|
}
|