OAuth - Service cloud stucked while acquiring token using .net addins
Content
Hi
On button click I need to Acquire Access token and using that token. Have to make Rest APi calls.
While acquiring the token itself the service cloud stucked and unable to perform any operation. I
Attached code please provide me a solution.
ThanksInAdvance.
Code Snippet
private void button1_Click(object sender, EventArgs e) { authContext = new AuthenticationContext(authority); clientCredential = new ClientCredential(clientId, appKey); PostTodo().Wait(); } static async Task PostTodo() { AuthenticationResult result = null; try { result = await authContext.AcquireTokenAsync(ResourceID, clientCredential); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
0