Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cesium.ITwinPlatform.defaultAccessToken should be a function instead of a string #12386

Open
jason-crow opened this issue Dec 20, 2024 · 0 comments

Comments

@jason-crow
Copy link
Contributor

Feature

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.

References:
iModel integration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant