using System.Threading.Tasks;
using IdentityServer4.Stores;
namespace OpenAuth.IdentityServer.Quickstart
{
public static class Extensions
{
///
/// Determines whether the client is configured to use PKCE.
///
/// The store.
/// The client identifier.
///
public static async Task IsPkceClientAsync(this IClientStore store, string client_id)
{
if (!string.IsNullOrWhiteSpace(client_id))
{
var client = await store.FindEnabledClientByIdAsync(client_id);
return client?.RequirePkce == true;
}
return false;
}
}
}