'How to extend powerBI token Id expiry time
How do I change the token Expiry time in power Bi?
Steps followed to generate token:
- Registered power Bi App
- After providing the details got the
client idand thesecret Id - Using
client idandsecret Id, I generated thetoken Idon myasp.net page. - Using this
token Id, I am able to access power bi report and bind intoiframe.
It's working but after 1-hour token Id expires and I need to generate the token Id again by providing the power username and password which the user doesn't want to key in.
Solution 1:[1]
Use setAccessToken to update the access token without reloading the embedded report when the token is about to expire.
You can Refresh the token Manually or Automatically.
await report.setAccessToken(newAccessToken);
Manually Update token: Set the newAcessToken Manually
let newAccessToken = await getNewUserAccessToken(reportId, groupId);
Automatically Update token: Provide token generating function it will set an event hook in embed config parameters and call function which generates new token and reassign to generated expiring token
References:
https://docs.microsoft.com/javascript/api/overview/powerbi/refresh-token
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Kotana Sai |
