{"action":"opened","issue":{"url":"https://api.github.com/repos/chrsmithdemos/google-api-java-client/issues/866","labels_url":"https://api.github.com/repos/chrsmithdemos/google-api-java-client/issues/866/labels{/name}","comments_url":"https://api.github.com/repos/chrsmithdemos/google-api-java-client/issues/866/comments","events_url":"https://api.github.com/repos/chrsmithdemos/google-api-java-client/issues/866/events","html_url":"https://github.com/chrsmithdemos/google-api-java-client/issues/866","id":59553795,"number":866,"title":"Storage API request from Compute Engine service account doesn't append OAuth token on redirected URL","user":{"login":"GoogleCodeExporter","id":9614759,"avatar_url":"https://avatars.githubusercontent.com/u/9614759?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCodeExporter","html_url":"https://github.com/GoogleCodeExporter","followers_url":"https://api.github.com/users/GoogleCodeExporter/followers","following_url":"https://api.github.com/users/GoogleCodeExporter/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCodeExporter/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCodeExporter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCodeExporter/subscriptions","organizations_url":"https://api.github.com/users/GoogleCodeExporter/orgs","repos_url":"https://api.github.com/users/GoogleCodeExporter/repos","events_url":"https://api.github.com/users/GoogleCodeExporter/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCodeExporter/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/chrsmithdemos/google-api-java-client/labels/auto-migrated","name":"auto-migrated","color":"ededed"},{"url":"https://api.github.com/repos/chrsmithdemos/google-api-java-client/labels/Priority-Medium","name":"Priority-Medium","color":"ededed"},{"url":"https://api.github.com/repos/chrsmithdemos/google-api-java-client/labels/Type-Defect","name":"Type-Defect","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-03-02T21:26:10Z","updated_at":"2015-03-02T21:26:10Z","closed_at":null,"body":"```\nVersion of google-api-java-client (e.g. 1.15.0-rc)?\ngoogle-api-hava-client 1.18.0-rc\ngoogle-api-services-storage v1beta2-rev42-1.18.0-rc\n\nJava environment (e.g. Java 6, Android 2.3, App Engine)?\nStandalone Java 7 environment running on Compute Engine\n\nDescribe the problem.\nI'm using the java api client libraries from inside Compute engine using \ncompute engine service accounts, an OAuth token is requested from the metadata \nserver to make a request to cloud storage:\n\nWhen the requested url looks like this:\nhttps://www.googleapis.com/storage/v1beta2/b/ecarf/o/linkedgeodata_links.nt.gz?o\nauth_token=ya29.1.AADtN_blahblahblah&alt=media\n\nA Temporary redirect is received:\nCONFIG: -------------- RESPONSE --------------\nHTTP/1.1 307 Temporary Redirect\nContent-Length: 201\nX-XSS-Protection: 1; mode=block\nExpires: Fri, 01 Jan 1990 00:00:00 GMT\nAlternate-Protocol: 443:quic\nLocation: https://storage.googleapis.com/ecarf/linkedgeodata_links.nt.gz\nServer: GSE\n\nThe api client follows the redirect, but without appending the OAuth token to \nthe url:\nApr 06, 2014 9:35:54 AM com.google.api.client.http.HttpRequest execute\nCONFIG: curl -v --compressed -H 'Accept-Encoding: gzip' -H 'User-Agent: ecarf \nGoogle-HTTP-Java-Client/1.18.0-rc (gzip)' -- \n'https://storage.googleapis.com/ecarf/linkedgeodata_links.nt.gz'\n\nand this fails with access denied. <?xml version='1.0' \nencoding='UTF-8'?><Error><Code>AccessDenied</Code><Message>Access \ndenied.</Message></Error> \n\nif I copy the redirect url and append the OAuth token to it and paste on the \nbrowser it works ok\nhttps://storage.googleapis.com/ecarf/linkedgeodata_links.nt.gz?oauth_token=ya29.\n1.AADtN_blahblahblah&alt=media\n\nHow would you expect it to be fixed?\n\nWhen receiving a redirect the api client should also append to the OAuth token \nwhen following the redirect\n\nThe debug logs are attached\n\n```\n\nOriginal issue reported on code.google.com by `omer.daw...@gmail.com` on 6 Apr 2014 at 10:15\n\nAttachments:\n* [debug_logs.txt](https://storage.googleapis.com/google-code-attachments/google-api-java-client/issue-866/comment-0/debug_logs.txt)\n"}}