-
Notifications
You must be signed in to change notification settings - Fork 598
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
Allow specifying access_token to use #1346
Comments
+1 to the issue. I've issued a pull request against var gcloud = require('gcloud')({
credentials: {accessToken: 'ACCESS_TOKEN_HERE'}
}); |
Thank you for the PR over there, @mbleigh! What do you think about just not using |
continuing from #1410 (comment) There are a couple edge cases:
@murgatroid99 is there a way to provide gRPC with just an access token? |
The simplest way to use a plain access token would be to add it to the call's metadata, the same way you would add it to headers for an HTTP request. If you don't want to deal with adding it to every call, you can also create a var creds = grpc.credentials.createFromMetadataGenerator(function(args, callback) {
var metadata = new Metadata();
metadata.add('authorization', 'Bearer: '+ access_token);
return metadata;
}); Then you can pass it to a call in the options field, or compose it with SSL credentials using |
Awesome, thanks! |
Hey there. We're planning on adding GCE support to our cloud management platform. Through we're planning on getting an auth token from our users with permission scopes into GCP. Today can we pass access_token directly to this client? Or should I manually be adding the |
@stephenplusplus -- is there anything to do more? |
any update? i really need to set my access token but i can't find a solution. |
+1 for this feature |
This issue was moved to googleapis/nodejs-common#11. |
Source-Link: googleapis/synthtool@d815daf Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest@sha256:a9d166a74752226923d159cb723df53429e226c9c076dad3ca52ffd073ff3bb4 Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Source-Link: googleapis/synthtool@d815daf Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest@sha256:a9d166a74752226923d159cb723df53429e226c9c076dad3ca52ffd073ff3bb4 Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
There are situations where you can end up with just the access_token. (eg. non-refereshable token for an endusers via oauth webflow).
There doesn't seem to be any way to place that raw token and initialize gcloud node. (gcloud-java recently added it in:
googleapis/google-cloud-java#1029
here are some references for the older googleapis node client:
https://github.com/google/google-api-nodejs-client#making-authenticated-requests
and a citation about overriding the config
#678 (comment)
The text was updated successfully, but these errors were encountered: