I am using the Management API to grab the idp access token for my user…
"identities": [
{
"access_token": "...",
"provider": "google-apps",
"user_id": "...",
"connection": "...",
"isSocial": false
}
],
Then I pass it to the google api in nodejs like this…
const client = new google.auth.OAuth2({
access_token: accessToken
});
const gmail = google.gmail({ version: 'v1', auth: client });
When I do this I get the following error
2023-02-02 13:36:34 /usr/src/app/node_modules/google-auth-library/build/src/auth/oauth2client.js:272
2023-02-02 13:36:34 throw new Error('No access, refresh token, API key or refresh handler callback is set.');
2023-02-02 13:36:34 ^
2023-02-02 13:36:34
2023-02-02 13:36:34 Error: No access, refresh token, API key or refresh handler callback is set.
What am I missing how do I handle this?