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

Share Zoom access token with Datastore #44

Open
harveysanders opened this issue Jan 5, 2023 · 1 comment
Open

Share Zoom access token with Datastore #44

harveysanders opened this issue Jan 5, 2023 · 1 comment

Comments

@harveysanders
Copy link
Contributor

This
https://cloud.google.com/appengine/docs/legacy/standard/go111/datastore/api-overview

Is your feature request related to a problem? Please describe.
Currently, we're fetching the Zoom access token on every request. We used to request a new token if the current token was expired, but since Zoom only allows one valid access token at a time, we ran into a race condition when another Function instance would request a new token.
Ex:
Instance A spins up and requests a token.
Soon after, instance B spins up and requests a new token, invalidating instance A's token
Then if A served another request, it would attempt to use the invalid previous token, since it has not yet expired.

Describe the solution you'd like
We could share one token using Datastore.

Pseudocode

Function

get token from Datastore
if token expired?
  request new token
  store token and expiresIn values in Datastore
  return token

return valid token  

Describe alternatives you've considered
Requesting a new token every invocation seems to work well enough now, but I think will fail with concurrent spikes of requests.

Additional context

@harveysanders
Copy link
Contributor Author

Apparently we're not the only one dealing with the issue: https://devforum.zoom.us/t/frequently-receiving-invalid-request-token-revocation-from-zoom/44220/16

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

No branches or pull requests

1 participant