Request.Headers.TryGetValue("some-header-name", out var headers); if(headers.Count > 1 || string.IsNullOrWhiteSpace(headers.FirstOrDefault())){ return new UnauthorizedResult(); }