using System.Threading.Tasks;
using IdentityModel.Client;
public static async Task Main()
Console.WriteLine("Hello World!");
var client = new HttpClient();
var disco = await client.GetDiscoveryDocumentAsync("https://local.gezond.nl/login");
Console.WriteLine(disco.Error);
var tokenResponse = await client
.RequestClientCredentialsTokenAsync(
new ClientCredentialsTokenRequest
Address = disco.TokenEndpoint,
ClientId = "CalendarService",
ClientSecret = "ea2c41ab-a310-49b1-a8e2-ad34b9a721e0"
if (tokenResponse.IsError)
Console.WriteLine(tokenResponse.Error);
Console.WriteLine(tokenResponse.Json);