private string ExtractCredential(AuthenticationHeaderValue authorizationHeaderValue) { if (authorizationHeaderValue.IsNull()) return string.Empty; return authorizationHeaderValue.GetBearerToken(); }
private static string[] ExtractCredentials( AuthenticationHeaderValue authorizationHeaderValue) { if (authorizationHeaderValue.IsNull() || authorizationHeaderValue.Scheme != "Basic") return new string[] { }; return authorizationHeaderValue.Parameter .FromBase64() .Split(new[] { ":" }, StringSplitOptions.RemoveEmptyEntries); }