GeezerVison is showing github.com — How to use Oauth Installed application authorization code flow with gcloud-node? · Issue #678 · googleapis/google-cloud-node
How to use Oauth Installed application authorization code flow with gcloud-node? #678Activityjgeewax commented on Jun 18, 2015 I think you're talking about 3LO (where a user gets a screen, and you get an OAuth2 token to use on their behalf, which you refresh from time to time...) right?
If so, we currently don't support that, as we're focused on server-to-server communication using service accounts. Pull-requests would be welcome for this, but we're not seeing a lot of customer demand for this one. dhermes commented on Jun 18, 2015 @jgeewax You can support it easily via grabbing the local token from gcloud login. For deployed applications, we should strongly advise against using anything but service accounts (be they via a file or directly via GCE or GAE). jgeewax commented on Jun 18, 2015 @dhermes : I believe we do pull the token from gcloud auth login already... I think this is about prompting the user for authorization (aka, do the work that gcloud auth login does) dhermes commented on Jun 18, 2015 Gotcher. I would cite the support for 3LO tokens minted via gcloud auth login as sufficient and would mark this as "Fixed" (closed on GH). tamalsaha commented on Jun 19, 2015 We are dynamically creating new GCP project and want to upload files there. Currently, you can only create new GCP projects using 3LO (service accounts does not work). So, we have no service account associated with those GCP projects. I can use gapi-nodejs-client to work around it. jgeewax commented on Jun 19, 2015 That makes sense -- a non-existent project doesn't have a service account that would have access.
That said, I think the only way to make that work is to steal the same code that something like gcloud auth login uses, and at that rate, you might as well run that command ... right? dhermes commented on Jun 22, 2015 If you don't want to require having the gcloud CLI installed, the GOOGLE_APPLICATION_CREDENTIALS environment variable is used with the "Google Default Credentials". You can pick it up as a secondary fallback. stephenplusplus commented on Aug 14, 2015 If you have the JSON object with client_id, client_secret, etc. for an authorized_user type, you can give that to gcloud:
var gcloud = require('gcloud')({
credentials: {
client_id: "1111.apps.googleusercontent.com",
client_secret: '...',
refresh_token: '...',
type: 'authorized_user'
}
});
@tamalsaha Is there any chance that is what you're looking for? stephenplusplus commented on Aug 24, 2015 @tamalsaha going to close, but please re-open if that doesn't resolve the issue.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|