You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace Id4Study.Test
|
|
|
|
|
{
|
|
|
|
|
public static class Id4Etx
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// GetDiscoveryDocumentAsync 重载版
|
|
|
|
|
/// (不强制使用https)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="client"></param>
|
|
|
|
|
/// <param name="address"></param>
|
|
|
|
|
/// <param name="mustHttps"></param>
|
|
|
|
|
/// <param name="cancellationToken"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static async Task<DiscoveryDocumentResponse> GetDiscoveryDocumentAsync
|
|
|
|
|
(
|
|
|
|
|
this HttpClient client,
|
|
|
|
|
string? address = null,
|
|
|
|
|
bool mustHttps=false,
|
|
|
|
|
CancellationToken cancellationToken = default
|
|
|
|
|
)
|
|
|
|
|
{
|
|
|
|
|
var policy = new DiscoveryDocumentRequest { Address = address };
|
|
|
|
|
policy.Policy.RequireHttps = mustHttps;
|
|
|
|
|
return await client.GetDiscoveryDocumentAsync(policy, cancellationToken).ConfigureAwait(false);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|