Refresh token for Dashboards - powerbi-embedded

I know we have a Refresh token working for Reports and on the old issue list I have raised a ticket for refreshing Dashboards token. Has this been fixed?
Thanks
Nick

dashboard.setToken(...) should be working just fine.. is it not working for you? what's the error you're receiving?

Related

How to work with Facebook Session Info Token?

I have a problem with the authentication by Facebook Native.
I use Facebook SDK Unity SDK - Documentation - Meta for Developers and it works as expected.
I get the access token and then try to exchange it to Session Info Token (as described here Add Facebook Login to Native Apps)
And I always get an error with an answer:
{“error”:{“message”:“Invalid OAuth access token data.”,“type”:“OAuthException”,“code”:190,“fbtrace_id”:“AHhJqfoR_8_IkrNdsSP4iPV”}}
I have tried the different tokens (short-lived, long-lived) and always got the error.
Is this option still work? Help anybody, thank you.

HttpError 403 when requesting https://www.googleapis.com/discovery/v1/apis/gmail/v1/rest returned "The caller does not have permission"

I have been using Gmail API to automatic email processing in production for many months now. All of a sudden since July 2, 2020 seeing the error message trying to access Gmail API.
HttpError 403 when requesting https://www.googleapis.com/discovery/v1/apis/gmail/v1/rest returned
"The caller does not have permission"
Checked Gmail Dashboard and the credentials are active noting was removed or modified.
Checked code and can confirm nothing changed for 3-4 months.
And we are not using old token. Our code takes care of expired credentials and does a token refresh.
Also tried removing the token.pickle file, when rerun re-authenticated using the Gmail Auth screen and token.pickle file is recreated however the error message cannot be resolved.
It looks like something changed in Google's end.
Can someone please confirm ?
When doing a search seems lot of ppl are seeing this in various APIs recently but no viable solution is provided.
This is a system-wide issue on Google's side: https://issuetracker.google.com/issues/160441983
logged against python api here: https://github.com/googleapis/google-api-python-client/issues/959. they seemed to be responsive before
There is a workaround using a local copy of the discovery json file posted in the thread yihlamur linked: https://issuetracker.google.com/u/1/issues/160441983#comment73. The workaround was successful for us.
I had this issue yesterday aswell. The issue has since been resolved. See - https://issuetracker.google.com/issues/160441983

Why are embedded reports not loading after longer period of being logged in?

I'm working on an ASP.NET MVC application that is using PowerBI Embedded to display some reports. I started with the application from the tutorial and have not made any changes to the code rendering the report. I did, however, update all the nuget packages to the latest versions.
In general, the app works fine and reports are being rendered correctly. However, sometimes I run into a problem where all the reports stop loading and I only get a flashing Power BI logo.
If I open a new browser session in incognito mode and log in on the same user it all works fine again. However, in the original tab it doesn't work until I close everything or reset the cache.
I noticed that it always happens after I am logged in for a longer period of time (30-60 minutes maybe). My best guess was that there's something wrong with the tokens, but I am not able to track it down.
Any hints what might be causing it?
UPDATE:
I just noticed that after longer period of time the logo stops flashing and I get an error "This content isn't available". When I look into the browser console I get this:
wabi-west-europe-b-primary-redirect.analysis.windows.net/explore/reports/fcbf92f1-f8d7-4c61-aeb3-06f195835413/modelsAndExploration?preferReadOnlySession=true:1 Failed to load resource: net::ERR_SPDY_PROTOCOL_ERROR
reportEmbed.min.js:1 ERROR Error: Uncaught (in promise): Object: {"message":"LoadReportFailed","detailedMessage":"Get report failed","level":6,"technicalDetails":{"requestId":"6d99f480-0f1c-47d0-9598-cab569018dd0"}}
at A (reportEmbed.min.js:1)
at A (reportEmbed.min.js:1)
at reportEmbed.min.js:1
at e.invokeTask (reportEmbed.min.js:1)
at Object.onInvokeTask (reportEmbed.min.js:1)
at e.invokeTask (reportEmbed.min.js:1)
at t.runTask (reportEmbed.min.js:1)
at g (reportEmbed.min.js:1)
at t.invokeTask (reportEmbed.min.js:1)
at i.useG.invoke (reportEmbed.min.js:1)
Ye # reportEmbed.min.js:1
This happens because the embedToken you use for retrive the dashboard from the powerBi rest api expires after approx 1 hour.
You have to refresh the token with a new one before the token expires, and this is not automatically handled from the Microsoft api (as far as i know).
You have to use the authentication token previously obtained and requets a new embedToken.
Consider that also the authentication token expires after some time, if this happens you have to obtain a new one before the request of the new embed token.
You can do this re-logging with user/pass or, a better solution, using the refresh token that the api gives you when you authenticate (when autenticated you retrive an auth token and a refresh token you can use for request a fresh auth token without logging again with user-pass).
Some azure documentation here about the authentication for use an azure resource.
Update:
Consider also that in the object embedToken you obtain there is the expiration date you can use for refresh the token before it expires, here some docs from azure
The problem was, as EttoreP correctly pointed, casued by an expired token. However, the main culprit was caching. My App is not a Single Page Application, so the token should be acquired with every page load. It appeared that the results were cached for longer than the expiration time of the token. After running the page again after an hour it was using the cached token and causing errors. Adding an OutputCache attribute to the controller solved the problem. Thanks for the help and good hints!
[OutputCache(NoStore = true, Duration = 0)]
This happens because your of your implementation, a good ETL can be resolve your problem, but check your connection and the cache timeout implementation.

AWS amplify error on signOut()

I am unable to sign out from Cognito after connecting with AES Amplify via withAuthenticator.
The first time the app shows up, it presents the login screen. After logging in it works normally. Then if I call:
Auth.signOut()
It gives the error:
null is not an object (evaluating 'this.credentials.clearCachedId')
and stays logged in. Same with the Greetings sign out buttom from Amplify. I just can't sign out. It seems to happen when using tab navigators.
Any ideas? Thanks in advance.
Hey I think this have been solved in the latest version. Could you update the library and try again?

CSRF Verification failing for some users

I'm getting complaints from a user who is constantly getting a CSRF 403 error when he tries to login to my site (using django.contrib.auth.views.login).
I don't get this error myself, and have no other users complaining of the issue. Any idea what it could be? How should I go about debugging this?
Is there a way to log detailed information about CSRF failures so I can try to inspect the user's state when they login. I don't want to turn DEBUG=True for an external user...
Based on your reply to my comment, I am not sure what is causing this issue. I would use CSRF_FAILURE_VIEW to implement a custom view that would give you more information about what is happening.
I recently ran into that and it turned out to be a cookie problem, as in the end user had them disabled.