You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have been integrating Google Business Messages into our application and have been using the Quick Start document and Samples as a guide on how to authenticate with the APIs.
We noticed that the guide uses the following code for initialising the auth token:
Referring to the API documentation for the google-auth-library, we noticed that refreshAccessToken() is an async function and wondered whether we should be awaiting the call in our initialisation code.
After some research we also wondered whether the call to refreshAccessToken() is still necessary since there are several threads suggesting that it may no longer be needed (along with it being deprecated, then subsequently undeprecated again).
Here are some links to the relevant threads/documents:
Therefore, my question is whether or not the Quick Start guide and sample are still correct or is there a potential race condition or other issue with the token initialisation code?
If we should be using await or replacing refreshAccessToken() with something else, then what does that code look like and can the Quick Start guide and sample be updated?
Thanks!
The text was updated successfully, but these errors were encountered:
We have been integrating Google Business Messages into our application and have been using the Quick Start document and Samples as a guide on how to authenticate with the APIs.
We noticed that the guide uses the following code for initialising the auth token:
Referring to the API documentation for the
google-auth-library
, we noticed thatrefreshAccessToken()
is anasync
function and wondered whether we should beawait
ing the call in our initialisation code.After some research we also wondered whether the call to
refreshAccessToken()
is still necessary since there are several threads suggesting that it may no longer be needed (along with it being deprecated, then subsequently undeprecated again).Here are some links to the relevant threads/documents:
refreshAccessToken()
: https://cloud.google.com/nodejs/docs/reference/google-auth-library/latest/google-auth-library/oauth2client#google_auth_library_OAuth2Client_refreshAccessToken_member_1_refreshAccessToken()
is still needed and what should replace it: Document correct OAuth2 handling of invalid_credentials errors vs deprecated methods googleapis/google-auth-library-nodejs#575refreshAccessToken()
: feat: do not deprecate refreshAccessToken googleapis/google-auth-library-nodejs#804refreshAccessToken()
withoutawait
: https://github.com/google-business-communications/bm-nodejs-echo-bot/blob/master/full_sample/routes/index.js#L299Therefore, my question is whether or not the Quick Start guide and sample are still correct or is there a potential race condition or other issue with the token initialisation code?
If we should be using
await
or replacingrefreshAccessToken()
with something else, then what does that code look like and can the Quick Start guide and sample be updated?Thanks!
The text was updated successfully, but these errors were encountered: