Forum Discussion
paulinuk2017
8 years agoFrequent Visitor
Simple example needed for rest api with azure
Hello Does anyone know of an start to finish sample for power bi api? I need to get data in real time and also to clear existing data from a data set in my dashboard Most of the samples I hav...
paulinuk2017
8 years agoFrequent Visitor
Hello
I get a bad request error?
Do I need do any special formatting anywhere?
Paul
paulinuk2017
8 years agoFrequent Visitor
Can I have the code for the logging in with a gui please?
I want to check if the token is returned that way?
Paul
- Eric_Zhang8 years agoMicrosoft Employee
paulinuk2017 wrote:
Can I have the code for the logging in with a gui please?
I want to check if the token is returned that way?
Paul
static string getAccessTokenWithLoginPopUp() { if (token == String.Empty) { //Get Azure access token // Create an instance of TokenCache to cache the access token TokenCache TC = new TokenCache(); // Create an instance of AuthenticationContext to acquire an Azure access token authContext = new AuthenticationContext(authority, TC); // Call AcquireToken to get an Azure token from Azure Active Directory token issuance endpoint token = authContext.AcquireToken(resourceUri, clientID, new Uri(redirectUri), PromptBehavior.RefreshSession).AccessToken; } else { // Get the token in the cache token = authContext.AcquireTokenSilent(resourceUri, clientID).AccessToken; } return token; }