mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-09-20 10:37:55 +08:00
转移.net core 3.1,为.NET 5做准备
This commit is contained in:
25
OpenAuth.Identity/Quickstart/Extensions.cs
Normal file
25
OpenAuth.Identity/Quickstart/Extensions.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System.Threading.Tasks;
|
||||
using IdentityServer4.Stores;
|
||||
|
||||
namespace OpenAuth.IdentityServer.Quickstart
|
||||
{
|
||||
public static class Extensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Determines whether the client is configured to use PKCE.
|
||||
/// </summary>
|
||||
/// <param name="store">The store.</param>
|
||||
/// <param name="client_id">The client identifier.</param>
|
||||
/// <returns></returns>
|
||||
public static async Task<bool> 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;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user