I am trying to use the YouTube V3 data API with Node, trying to provide an authenticated proxy server when doing search queries. Since the service will be running on the server, I created a service account.
This leads to the download of the key file and the following information:
I have a very general understanding of JWT, but the service section on the OAuth2 page suggested that you should use one of your libraries to do this, and not implement it yourself. However, they do not list the Node library in their supported libraries .
A little more digging and I came across a Google Nodejs client: https://github.com/google/google-api-nodejs-client , which claims to be supported by Google and has OAuth2 support out of the box.
The docs are pretty minimal, and authentication examples include typing a URL into a terminal and then visiting it in a browser to create a token. I have to dig around the source to find out if it supports JWT, and it looks like it has JWTClient .
function JWT(email, keyFile, key, scopes, subject) {
JWT.super_.call(this);
this.email = email;
this.subject = subject;
this.keyFile = keyFile;
this.key = key;
this.scopes = scopes;
this.GAPI = GAPI;
}
This comment on the document over the constructor is apparently the only explanation here, and I still don't know how to use this function.
I guess:
email - email address of your developer accountkeyFile is the path to the private keykeyis a private key? (If so, why include the path?)scopes - API, .subject
- ?
, , , , , 200 ( - ).