1

Could you help me figure out what's wrong with my code for google auth? I'm developing a nodejs app that should connect to my Youtube account to start live-streaming my camera but i can't go past authentication phase.

I keep receiving the same error: "key must be a string, a buffer or an object" but i'm providing the credentials.json file as per downloaded from Google Console.. Thanks

index.js:

const { google } = require('googleapis');
 
const auth = new google.auth.GoogleAuth({
    keyFilename: 'credentials.json',
    scopes: ['https://www.googleapis.com/auth/youtube.force-ssl']
});

const youtube = google.youtube({
    version: 'v3',
    auth: auth
});

credentials.json:

{
    "web": {
        "client_id": "xxxxxxx.apps.googleusercontent.com",
        "project_id": "myproj-xxxx",
        "auth_uri": "https://accounts.google.com/o/oauth2/auth",
        "token_uri": "https://oauth2.googleapis.com/token",
        "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
        "client_secret": "xxxxxxxx"
    }
}

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.