Please bare with me. Rookie on the block. I am tasked to provide clientcallback url and this needed to authenticate zoho desk
host: https://accounts.zoho.com
path: /oauth/v2/auth
response_type: code
client_id: ###
scope: Desk.tickets.READ,Desk.basic.READ,Desk.tickets.CREATE,Desk.basic.CREATE
redirect_uri: mydomain.com/authenticate
Question is how do I create a page call it authenticate and get the token back?
What I have tried:
string baseAddress = "http://localhost/";
var client = new HttpClient();
var form = new Dictionary<string, string>
{
{"grant_type", "client_credentials"},
{"client_id", "clientId"},
{"client_secret", "secretKey"},
};
var tokenResponse = client.PostAsync(baseAddress + "accesstoken", new FormUrlEncodedContent(form)).Result;
var token = tokenResponse.Content.ReadAsAsync<Token>(new[] { new JsonMediaTypeFormatter() }).Result;
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.AccessToken);
var authorizedResponse = client.GetAsync(baseAddress + "/api/Tests").Result;