public static bool SupportsPartialRecaptcha(this IIdentityServerRecaptchaOptions openIdConnectRequestOptions, IOpenIdConnectRequest openIdConnectRequest) { var basicAuthenticationHeaderValue = openIdConnectRequest.GetBasicAuthenticationHeaderValue(); if (string.IsNullOrEmpty(basicAuthenticationHeaderValue)) { return(true); } var basicAuthenticationHeaders = openIdConnectRequestOptions.WebClients.Select(client => Convert.ToBase64String(Encoding.UTF8.GetBytes($"{client.ClientId}:{client.Secret}"))) .Select(authorizationValue => new AuthenticationHeaderValue("Basic", authorizationValue)); return(basicAuthenticationHeaders .Any(authenticationHeaderValue => { return authenticationHeaderValue.ToString() == basicAuthenticationHeaderValue; })); }