You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Propose that Cesium.ITwinPlatform.defaultAccessToken be converted to Cesium.ITwinPlatform.getDefaultAccessToken as an async function instead of a string
The main justification of this change is to avoid dealing with that token expiring.
As a static string, unless the user resets it, the token will expire and if they set it to a variable the reference will be lost and again it will expire.
As an async function it always grabs the latest token. The consumer is forced to call it before they use it, but as tokens are always used for async requests to a service, this should not be a problem. Additionally, if they do save it on a variable the result is still a valid token. Effectively, you are free from this expiration contingency now.
Feature
Propose that
Cesium.ITwinPlatform.defaultAccessToken
be converted toCesium.ITwinPlatform.getDefaultAccessToken
as an async function instead of a stringThe main justification of this change is to avoid dealing with that token expiring.
As a static string, unless the user resets it, the token will expire and if they set it to a variable the reference will be lost and again it will expire.
As an async function it always grabs the latest token. The consumer is forced to call it before they use it, but as tokens are always used for async requests to a service, this should not be a problem. Additionally, if they do save it on a variable the result is still a valid token. Effectively, you are free from this expiration contingency now.
References:
iModel integration
The text was updated successfully, but these errors were encountered: