Error: No access, refresh token or API key is set. setCredentials
See original GitHub issue<your detailed question and code samples go here>
// Retrieve tokens via token exchange explained above or set them:
oauth2Client.setCredentials({
access_token: 'ACCESS TOKEN HERE',
refresh_token: 'REFRESH TOKEN HERE'
// Optional, provide an expiry_date (milliseconds since the Unix Epoch)
// expiry_date: (new Date()).getTime() + (1000 * 60 * 60 * 24 * 7)
});
this used to work, lately when I updated version, it says
TypeError: oauth2Client.setCredentials is not a function
somewhere in the issues, it was suggested to switch to oauth2Client.setCredentials = { access_token: process.env[‘ACCESS_TOKEN’], refresh_token: process.env[‘REFRESH_TOKEN’], expiry_date: true };
and now it returns Error: No access, refresh token or API key is set. How to solve this problem?
Thank you in advance!
Issue Analytics
- State:
- Created 6 years ago
- Comments:13 (3 by maintainers)
Top Results From Across the Web
Google API. No access, refresh token, API key or refresh ...
'Error: No access, refresh token, API key or refresh handler callback is set.' I can not find a solid reference to this, I...
Read more >Error: No access, refresh token or API key is set – iTecNote
Yes I have downloaded the json, renamed to client_secret.json and added to the application folder. Here is the code: const fs = require('fs');...
Read more >Google APIs Node.js Client - googleapis documentation
OAuth2 client; Using API keys; Application default credentials ... The user has revoked your app's access; The refresh token has not been used...
Read more >Implementing Server-Side Authorization | Gmail
This access token is passed to the Gmail API to grant your application access to user data for a ... """Error raised when...
Read more >google-auth-library - npm
getToken (code); // Make sure to set the credentials on the OAuth2 client. oAuth2Client.setCredentials(r.tokens); console.info('Tokens ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@piavgh @bantini Here’s what worked for me:
FWIW, here’s the modified (from this) code I use on Cloud Functions which is limited to Node 6.14.0