{"action":"created","issue":{"url":"https://api.github.com/repos/miasma-rb/miasma/issues/14","labels_url":"https://api.github.com/repos/miasma-rb/miasma/issues/14/labels{/name}","comments_url":"https://api.github.com/repos/miasma-rb/miasma/issues/14/comments","events_url":"https://api.github.com/repos/miasma-rb/miasma/issues/14/events","html_url":"https://github.com/miasma-rb/miasma/issues/14","id":109204969,"number":14,"title":"difficulty getting AWS token authentication working","user":{"login":"cixelsyd","id":654692,"avatar_url":"https://avatars.githubusercontent.com/u/654692?v=3","gravatar_id":"","url":"https://api.github.com/users/cixelsyd","html_url":"https://github.com/cixelsyd","followers_url":"https://api.github.com/users/cixelsyd/followers","following_url":"https://api.github.com/users/cixelsyd/following{/other_user}","gists_url":"https://api.github.com/users/cixelsyd/gists{/gist_id}","starred_url":"https://api.github.com/users/cixelsyd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cixelsyd/subscriptions","organizations_url":"https://api.github.com/users/cixelsyd/orgs","repos_url":"https://api.github.com/users/cixelsyd/repos","events_url":"https://api.github.com/users/cixelsyd/events{/privacy}","received_events_url":"https://api.github.com/users/cixelsyd/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-10-01T00:12:25Z","updated_at":"2015-10-01T15:44:44Z","closed_at":null,"body":"I have to use my AWS access key and secret to assume a role and receive an STS token in order to access my AWS account.  I am unable to get Miasma working with STS token authentication.\r\n\r\nI am currently providing the following to Miasma for credentials:\r\n\r\n%w(AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY AWS_REGION AWS_STS_ROLE_ARN AWS_STS_ROLE_SESSION_NAME)\r\n\r\nWhen I provide this same information to the python AWS CLI, it returns a new set of keys/id/token for me to use, and I am able to make my API calls successfully, however: Miasma fails.\r\n\r\nFor a different set of keys that do not require STS tokens, I am able to authenticate just fine and enumerate ec2 instances, s3 buckets, etc.  For example, for my keys that do not require tokens, when I do not submit the STS parameters, the following works:\r\n\r\n```ruby\r\n%w(AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY AWS_REGION ).each do |env|\r\n  if(ENV[env])\r\n    cloud_creds[env.downcase.to_sym] = ENV[env]\r\n  else\r\n    exit 1\r\n  end\r\nend\r\n\r\ncompute = Miasma.api(\r\n  :type => :compute,\r\n  :provider => :aws,\r\n  :credentials => cloud_creds\r\n)\r\nputs compute.servers.all\r\n```\r\n\r\nMiasma receives a single HTTP 200 response, and then gives me the list of servers.\r\n\r\nInterestingly, when I attempt nearly the same thing for my keys that do require me to assume a role, \r\nit appears that miasma makes two connections.  The first one is an HTTP 200, and the second returns a 401, and causes an error.\r\n\r\nWhat can I do to help you debug further?  Thanks!\r\n"},"comment":{"url":"https://api.github.com/repos/miasma-rb/miasma/issues/comments/144766990","html_url":"https://github.com/miasma-rb/miasma/issues/14#issuecomment-144766990","issue_url":"https://api.github.com/repos/miasma-rb/miasma/issues/14","id":144766990,"user":{"login":"chrisroberts","id":266674,"avatar_url":"https://avatars.githubusercontent.com/u/266674?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisroberts","html_url":"https://github.com/chrisroberts","followers_url":"https://api.github.com/users/chrisroberts/followers","following_url":"https://api.github.com/users/chrisroberts/following{/other_user}","gists_url":"https://api.github.com/users/chrisroberts/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisroberts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisroberts/subscriptions","organizations_url":"https://api.github.com/users/chrisroberts/orgs","repos_url":"https://api.github.com/users/chrisroberts/repos","events_url":"https://api.github.com/users/chrisroberts/events{/privacy}","received_events_url":"https://api.github.com/users/chrisroberts/received_events","type":"User","site_admin":false},"created_at":"2015-10-01T15:44:44Z","updated_at":"2015-10-01T15:44:44Z","body":"The access key ID and secret key are used to generate the signature for the request so you won't see them specified within the parameters of the request itself.\r\n\r\nI'm going to need to get my stub user and role setup for testing and see if I can replicate what you are experiencing. I don't see anything jumping out at me that would cause this behavior. Will hopefully have some answers by this afternoon."}}