{"action":"created","issue":{"url":"https://api.github.com/repos/FineUploader/fine-uploader/issues/1406","repository_url":"https://api.github.com/repos/FineUploader/fine-uploader","labels_url":"https://api.github.com/repos/FineUploader/fine-uploader/issues/1406/labels{/name}","comments_url":"https://api.github.com/repos/FineUploader/fine-uploader/issues/1406/comments","events_url":"https://api.github.com/repos/FineUploader/fine-uploader/issues/1406/events","html_url":"https://github.com/FineUploader/fine-uploader/issues/1406","id":73344991,"number":1406,"title":"It's not possible to supply sessionToken if request is being signed by backend","user":{"login":"eugenebond","id":1640934,"avatar_url":"https://avatars.githubusercontent.com/u/1640934?v=3","gravatar_id":"","url":"https://api.github.com/users/eugenebond","html_url":"https://github.com/eugenebond","followers_url":"https://api.github.com/users/eugenebond/followers","following_url":"https://api.github.com/users/eugenebond/following{/other_user}","gists_url":"https://api.github.com/users/eugenebond/gists{/gist_id}","starred_url":"https://api.github.com/users/eugenebond/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eugenebond/subscriptions","organizations_url":"https://api.github.com/users/eugenebond/orgs","repos_url":"https://api.github.com/users/eugenebond/repos","events_url":"https://api.github.com/users/eugenebond/events{/privacy}","received_events_url":"https://api.github.com/users/eugenebond/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/FineUploader/fine-uploader/labels/1%20-%20Investigate","name":"1 - Investigate","color":"fbca04"},{"url":"https://api.github.com/repos/FineUploader/fine-uploader/labels/enhancement","name":"enhancement","color":"0b02e1"},{"url":"https://api.github.com/repos/FineUploader/fine-uploader/labels/S3","name":"S3","color":"5319e7"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/FineUploader/fine-uploader/milestones/74","html_url":"https://github.com/FineUploader/fine-uploader/milestones/5.12.0","labels_url":"https://api.github.com/repos/FineUploader/fine-uploader/milestones/74/labels","id":1830933,"number":74,"title":"5.12.0","description":null,"creator":{"login":"rnicholus","id":593312,"avatar_url":"https://avatars.githubusercontent.com/u/593312?v=3","gravatar_id":"","url":"https://api.github.com/users/rnicholus","html_url":"https://github.com/rnicholus","followers_url":"https://api.github.com/users/rnicholus/followers","following_url":"https://api.github.com/users/rnicholus/following{/other_user}","gists_url":"https://api.github.com/users/rnicholus/gists{/gist_id}","starred_url":"https://api.github.com/users/rnicholus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rnicholus/subscriptions","organizations_url":"https://api.github.com/users/rnicholus/orgs","repos_url":"https://api.github.com/users/rnicholus/repos","events_url":"https://api.github.com/users/rnicholus/events{/privacy}","received_events_url":"https://api.github.com/users/rnicholus/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":0,"state":"open","created_at":"2016-06-15T21:52:48Z","updated_at":"2016-06-15T21:53:03Z","due_on":null,"closed_at":null},"comments":27,"created_at":"2015-05-05T15:25:10Z","updated_at":"2016-06-29T12:51:30Z","closed_at":null,"body":"Hi,\r\n\r\nI have the following configuration\r\n```\r\n  <script type=\"text/javascript\">\r\n    $(function() {\r\n      $('#fineUploader').fineUploaderS3({\r\n          template: 'qq-template',\r\n          request: {\r\n              endpoint: \"https://MY-BUCKET-HERE.s3.amazonaws.com\",\r\n          },\r\n          credentials: {\r\n              accessKey: \"...\",\r\n              sessionToken: \"...\",\r\n              expiration: \"2015-05-06\",\r\n          },\r\n          signature: {\r\n              endpoint: \"/my_end_point\"\r\n          },\r\n          uploadSuccess: {\r\n              endpoint: \"index.html\"\r\n          },\r\n          chunking: {\r\n              enabled:   true,\r\n              mandatory: true,\r\n          }\r\n      });\r\n    });\r\n  </script>\r\n```\r\n\r\nThe headers that end up being POST-ed to the backend are the following\r\n```\r\nPOST\r\n\r\nimage/gif\r\n\r\nx-amz-acl:private\r\nx-amz-date:Tue, 05 May 2015 15:11:11 GMT\r\nx-amz-meta-qqfilename:600-animated.gif\r\n/MY-BUCKET-HERE/9c061d9f-c743-4831-93cd-d4fd7cc72896.gif?uploads\r\n```\r\n\r\nSince `x-amz-security-token` is missing here, this never gets authenticated by Amazon. I tried plugging `sessionToken` in different places, e.g. into `request` but never managed to get it to work.\r\n\r\nAlso on a side note, for the example above, the header that gets sent to Amazon is \r\n`Authorization:AWS null:signture-goes-here`. So it appears that `credentials.accessKey` does not get picked up because it considers `credentials` set to be incomplete without `secretKey` in it (which I don't want to put there, I want the request to be signed by backend). I am not sure if it's a bug or intended behavior. \r\n\r\nI managed to get all of this working in one of two ways:\r\n- by supplying all 4 values into `credentials`\r\n- by having `request.accessKey` set and hacking JS code to set `x-amz-security-token` like this `headers[\"x-amz-security-token\"] = 'a string with my token'`\r\n\r\n\r\nVersion: 5.2.1"},"comment":{"url":"https://api.github.com/repos/FineUploader/fine-uploader/issues/comments/229346170","html_url":"https://github.com/FineUploader/fine-uploader/issues/1406#issuecomment-229346170","issue_url":"https://api.github.com/repos/FineUploader/fine-uploader/issues/1406","id":229346170,"user":{"login":"trauts2","id":4002664,"avatar_url":"https://avatars.githubusercontent.com/u/4002664?v=3","gravatar_id":"","url":"https://api.github.com/users/trauts2","html_url":"https://github.com/trauts2","followers_url":"https://api.github.com/users/trauts2/followers","following_url":"https://api.github.com/users/trauts2/following{/other_user}","gists_url":"https://api.github.com/users/trauts2/gists{/gist_id}","starred_url":"https://api.github.com/users/trauts2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trauts2/subscriptions","organizations_url":"https://api.github.com/users/trauts2/orgs","repos_url":"https://api.github.com/users/trauts2/repos","events_url":"https://api.github.com/users/trauts2/events{/privacy}","received_events_url":"https://api.github.com/users/trauts2/received_events","type":"User","site_admin":false},"created_at":"2016-06-29T12:51:30Z","updated_at":"2016-06-29T12:51:30Z","body":"Count me in if you think I'd be helpful. I just did a bit of a deep dive\ninto IAM instance profiles and at the very least can provide a working\ntestbed\n\nOn Wednesday, June 29, 2016, Ray Nicholus <notifications@github.com> wrote:\n\n> Cool, thanks Mike. I'm mostly interested in being sure that I understand\n> how to use STS properly in a real-world scenario, using AWS best practices.\n> Let's talk next week. If anyone else in this thread is interested in\n> contributing information about their intended use of STS/temp credentials,\n> please let me know ASAP. Perhaps we can all chat at once.\n>\n> —\n> You are receiving this because you were mentioned.\n> Reply to this email directly, view it on GitHub\n> <https://github.com/FineUploader/fine-uploader/issues/1406#issuecomment-229258369>,\n> or mute the thread\n> <https://github.com/notifications/unsubscribe/AD0TaMH5JsGSFtjze9Qac_Jyz53A8Dzwks5qQf9OgaJpZM4EQYP9>\n> .\n>\n"}}
{"actor":{"display_login":"trauts2"}}