I currently have a working implementation of retrieving an access token by using getTokenSilently, which is then used to authorize a user’s request when making API calls (behind the scene).
The issue I’ve encountered is that each time a token is retrieved it appears to use our allocated M2M usage. I was under the impression that M2M usage only applied to backend services but that simply isn’t true. I’d also like to note that it’s difficult to tell if the usage applies whenever a token is retrieved or on every single token retrieval. This is primarily due to the fact that the usage data lags behind actual usage so it’s impossible to get a good handle on your usage in realtime.
So what is the most optimal way to make getting a token efficient whilst cutting down on M2M usage within a SPA?
I have also shared the token expirations and was beginning to wonder if extending the browser expiration would be the only way to “optimize” usage.
SPA ID Token Expiration (Seconds): 36000
Token Expiration For Browser Flows (Seconds): 7200
Token Expiration (Seconds) : 86400
SDK Version: 1.13.6
Platform Version: Vue 2.6.12