-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possible to load client_secret JSON ? #266
Comments
Are you talking about JSON key file for service accounts? If so, currently the answer is no.
Each API documents its own requirements for scopes. You can take a look at https://developers.google.com/oauthplayground/ for reference though.
We support OAuth 2.0 web server, installed apps and service accounts flows. Which one are you planning to use? |
I am building a web app so we can manage our cluster. I was thinking I would set up a GCE instance with a node.js server and have that server run all the commands. I could let our developers log into that server using Oauth2. So a Client ID for web application is what I would need I think from looking at all the Oauth docs. Is there an example of using "service accounts flows" ? how would I use that? From looking at the python api that would allow me to use my own login system correct? I have attempted to use the example made a few modification to try to use with compute engine like so I then run with node, login at the url provided , allow access to "offline", copy paste the code returned in the url (looks like "4/Y2x...."). I then get the response An error occured { errors: I was able to use the python api here (with a "service account" and JSON key) without a problem and it correctly lists my instances I can also successfully use the api explorer. |
This is days in the works, but will hopefully help clear a thing or two up. "google-api-nodejs-client examples using JWT and service account" https://gist.github.com/rainabba/25d1972f455b71916952 |
I have same problem. |
Greetings! The docs here have improved a great deal over the last looks down 4 years. If this is still an issue - feel free to open a new bug! |
Updated after my 3rd attempt in 2 years to get Drive support in my node app, but being thwarted by volumes of confusing documents, conflicting examples and various approaches. As of 2018-05-09, this approach is "current" in that is uses the latest approach from the console, but it uses API v25 because v29 breaks completely with these samples and I can't find any docs that address those issues. Here's my updated gist that requires a client_secret.json, will provide a URL, take the code and save a .token file next to the source .json. It uses the Nodejs debugger to halt code and get the code value in the debugger because I was having issues that made me leary about the console and the debugger works so well anyway :) |
This explains that particular challenge: #1158 I was so caught up in the keys for a while that I'd missed the obvious. That code is what got me as far as the above gist btw. With it I learned the flow and rebuilt it. Now that I FINALLY have a token, it's time to see if I can do what I've set out to, saving PDFs directly to Drive. |
Just over a month later and I've finally released node-cloudfs-drive: https://www.npmjs.com/package/node-cloudfs-drive Hopefully this will fill the gap I see at least 10 other projects trying to do (or had tried in the past) and I intend to maintain this for at least a couple years unless Google finally pushes me over the edge with more anti-enterprise behavior on Drive (like not letting me install Drive File Stream on a server, or throttling my API calls so that I can't have a properly optimized lookup system with our 100,000's of objects we maintain there). That's another convo though :) |
1.) Instead of setting the clientid secret and redirect manually is it possible to load the JSON file one can download from the Developer Console?
2.) Is there a list somewhere of what scopes are need for each service? I am having trouble getting the compute api to work. Could the apis load the scopes needed implicitly?
3.) Just to make sure, I need to use the Oauth2 "installed application" option for this api correct?
The text was updated successfully, but these errors were encountered: