private async void acquireTokenWithClientCredentialButton_Click(object sender, EventArgs e) { this.accessTokenTextView.Text = string.Empty; TokenBroker tokenBroker = new TokenBroker(); string token = await tokenBroker.GetTokenWithClientCredentialAsync(); this.accessTokenTextView.Text = token; }
private static async Task AcquireTokenAsync() { TokenBroker tokenBroker = new TokenBroker(); string token = await tokenBroker.GetTokenInteractiveAsync(new PlatformParameters(PromptBehavior.Auto, null)); Console.WriteLine(token + "\n"); token = await tokenBroker.GetTokenWithUsernamePasswordAsync(); Console.WriteLine(token + "\n"); token = await tokenBroker.GetTokenWithClientCredentialAsync(); Console.WriteLine(token); }
async partial void UIButton25_TouchUpInside(UIButton sender) { try { ReportLabel.Text = string.Empty; TokenBroker tokenBroker = new TokenBroker(); string token = await tokenBroker.GetTokenWithClientCredentialAsync(); ReportLabel.Text = token; } catch (Exception ex) { throw ex; } }