-
Notifications
You must be signed in to change notification settings - Fork 862
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
[Question] How does token Caching work #23121
Comments
Hi @TheCreatorAMA, since your question is about the Go SDK I am transferring this issue to the Go repository. |
Thanks for opening this issue. All credentials that don't delegate to external tools cache tokens automatically, storing them in memory by default. These in-memory caches don't survive the credential instances that create them, so if your request handler calls |
That explanation helps! So if I cache the credential instances, the background in-memory caching should fetch a new token if needed right? To make sure I'm understanding this correctly. |
Yes. When your app calls |
Alright makes sense thanks for the explanation! |
I have dug around and was reading on how token caching works but I am still a bit confused and figured I would ask here in case anyone else would find this useful.
I have some code similar to the below:
This code gets called on every request but Im noticing that a new token is being generated each time. Im fairly positive im just not understanding something but as the user is there something I need to do to see if the client already has a token? Or does it happen automatically when credentials are made?
The text was updated successfully, but these errors were encountered: