Repository navigation
Authorization: Bearer your_auth_token (how to get auth_token) #818
Description
Activity
We don't have this officially supported, but there's an opening if you go through some private properties.
With your Storage instance, try:
var reqOpts = { uri: '...' }; // what you would pass to the request module storage.makeAuthorizedRequest_(reqOpts, { onAuthorized: function(err, authorizedReqOpts) { // authorizedReqOpts.headers.Authorization = 'bearer token' } });
I also made a module for exactly this which uses the same authorization settings as this library: https://github.com/stephenplusplus/google-auto-auth
I think our library could eventually add support for just starting a resumable upload, handing off the responsibility to the user to see it through. We currently support resumable uploads, but wrap the whole thing and hide away the details.
- Can we maybe create a ticket to allow this...? Resumable upload seems like a pretty reasonable thing to build... no?
Sure, new ticket it is. Thanks for bringing this issue up, @navicore!
- addedtype: questionRequest for information or clarification. Not an issue.Request for information or clarification. Not an issue.api: storageIssues related to the Cloud Storage API.Issues related to the Cloud Storage API.
on Aug 24, 2015 awesome help, thanks!
@navicore Since this issue, I moved all of our resumable logic into gcs-resumable-upload. You can use it to just get a resumable URI:
var upload = require('gcs-resumable-upload'); upload.createURI({ bucket: 'bucket-name', file: 'file-name', authConfig: { // how you normally auth to gcloud, ex: keyFilename: 'keyfile.json' } }, function (err, uri) {});
Is there the option to set the
originwith this method? We're trying to use our API to generate a resumable uri, but the client is running on a different subdomain.I think @janesconference was going to help us implement that in gcs-resumable-upload. I opened an issue about it here: googleapis/gcs-resumable-upload#6. Feel free to subscribe to that one to track the progress.
@stephenplusplus Any other options? Ie.,
createWriteStream? Or, is it that setting theoriginoption isn't available right now at all?I don't believe any other options exist, sadly. I'll work on adding support asap.
- added a commit that references this issue
on Jan 17, 2023 1 remaining item
- added a commit that references this issue
on Jan 25, 2023 - added 8 commits that reference this issue
on Jan 27, 2026 - added a commit that references this issue
on Mar 5, 2026 - added a commit that references this issue
on Mar 12, 2026 - added a commit that references this issue
on Mar 27, 2026
question: will the API give me the bearer token it is using?
I'm able to create signed urls with gcloud-node but I'm trying to follow the resumable download docs. they suggest starting an upload on the server and passing the session to the client. looks easy except for the header:
can i do something like gcs.getAuth after some kind of init?
thx for any help.