googleapis / nodejs-local-auth

A standalone library for receiving Google OAuth tokens
Apache License 2.0
35 stars 15 forks source link

Setting up hangs on authenticate() #149

Closed OakLoaf closed 2 years ago

OakLoaf commented 2 years ago

I am trying to setup the Google Docs API into a Node-JS file hosted on an ubuntu server. I've used the NodeJS Google Docs API Quickstart information and searched around for alternative answers but am unsure of what is the solution. The correct credentials.json is in place, however, when running: client = await authenticate({ scopes: SCOPES, keyfilePath: CREDENTIALS_PATH, }); It simply hangs for eternity, presumably this would be when a pop-up would appear on a Windows PC but this is not the case and no alternative seems to be obviously available.

OakLoaf commented 2 years ago

I created the same question in the google-api-nodejs-client repo prior to finding this repo so have duplicated it to here as it is likely more suitable to be in this repo.

sqrrrl commented 2 years ago

Are you ssh'd into that server? If so, that's likely the cause.

As implied in the name, this library is only for local usage where the process is running on the same device as the user. It needs to be able to open a web browser and the server it starts is bound to localhost. This library doesn't currently handle the headless server case. I'll update the quickstart guide to make that requirement clearer.

OakLoaf commented 2 years ago

Yeahh I am ssh'd in, that's heart breaking, I will have a look into alternative options.

danielbankhead commented 2 years ago

Duplicate: https://github.com/googleapis/google-api-nodejs-client/issues/3059