Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
using (var client = new HttpClient())
client.BaseAddress = new System.Uri("https://<your tenant>");
var response = await client.PostAsync("oauth/token", new FormUrlEncodedContent(
new Dictionary<string, string>
{ "grant_type", "client_credentials" },
{ "client_id", "<client_id>" },
{ "client_secret", "<client_secret>" },
{ "audience", "https://<your tenant>" }
var content = await response.Content.ReadAsStringAsync();
var jsonResult = JObject.Parse(content);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.