Thanks for reaching out to us,
Refresh tokens given to Single-Page Applications are limited-time refresh tokens (usually 24 hours from the time of retrieval). This is a non-adjustable, non-sliding window, lifetime. Whenever a refresh token is used to renew an access token, a new refresh token is fetched with the renewed access token. This new refresh token will have a lifetime equal to the remaining lifetime of the original refresh token. Once a refresh token has expired, a new authorization code flow must be initiated to retrieve an authorization code and trade it for a new set of tokens.
Note: When a new refresh token is obtained, msal.js replaces the cached refresh token with the new refresh token, however the old refresh token is not invalidated by the server and may still be used to obtain access tokens until its expiration.
kindly use doc to refresh token - https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/token-lifetimes.md
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Looks like, the main issue here is that you are trying to get a normal token than a refresh token, you don't have to refresh token every time, once it expired a new authentication code flow must be initiated and trade it for a new set of tokens, this has to be done on the code. We can use the acquireTokenSilent token-lifetimes.md which explains how to do so.
Hope i answered your question,
Don't I have to initially get a connection to a user's account by receiving an initial token (the first part of the code)
After that, I can't seem to find a way to persistently get a token that can be used to get busy times on their calendar to provide a scheduler with blocked times. The token eventually expires every time
Every response to my questions seem to just be copying and pasting from the docs. Nobody seems to understand my intended application
How in the world does Calendly use Outlook for the same purpose? There has to be a way
I was easily able to do it for Google Calendar but Outlook seems to be very limited