Forum Discussion
Integrate tile into an app sample javascript error.
Thank you for your reply! I still get the same error. My access token also starts with "eyJ0eXAiOiJ" and is very long. There are no new lines in the string and no whitespace. Can you do me one quick favor and open your browser developer console and execute:
atob("YOUR_ACCESS_TOKEN")and tell me if you get an error.
I've got the same error, however I can still embed with that token.
Embedding is working fine with the HTML in my previous reply. All responses 200(ok).
Not sure if it is the issue of the cluster node, will you try to replace the app.powerbi.com in the embed url with below IP, it is the actual remote server in my test, captured from the chrome dev tool.
https://13.78.91.196/embed?dashboardId=f1f5155bxxxxx914927d05&tileId=2dcd2a32-725e-4454-9753-b3
- ajhops9 years agoFrequent Visitor
When I try that IP address I get insecure response:
I also get all 200s but the tile never appears (only the spinning dots) and the JS error every time. The remote server I am hitting is 137.116.81.69:443.
- Eric_Zhang9 years agoMicrosoft Employee
Have you tested with my HTML? What's going on when in IE, do you still get the atob error? May I know how you generate the accessToken?
- ajhops9 years agoFrequent Visitor
When I run in IE I get "InvalidCharacterError". I believe this is the same error as before.
To answer your question, yes I am using your static HTML but replace with my token and tile URL. I generate my access token on my back end (.net MVC) using this line:
var ar = AC.AcquireTokenByAuthorizationCodeAsync( authorizationCode, new Uri(redirectUri), cc).Result; return ar.AccessToken;I later use that access token server side to get my list of dashboards and tiles, and the result is good, so I assume my token is good / correct (the variable _token below).
System.Net.WebRequest request = System.Net.WebRequest.Create( String.Format("{0}Dashboards", _baseUri )) as System.Net.HttpWebRequest; request.Method = "GET"; request.ContentLength = 0; request.Headers.Add("Authorization", String.Format("Bearer {0}", _token));