{"action":"created","issue":{"url":"https://api.github.com/repos/avidw/redd/issues/8","labels_url":"https://api.github.com/repos/avidw/redd/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/avidw/redd/issues/8/comments","events_url":"https://api.github.com/repos/avidw/redd/issues/8/events","html_url":"https://github.com/avidw/redd/issues/8","id":57840257,"number":8,"title":"Failed to authenticate","user":{"login":"beatak","id":23968,"avatar_url":"https://avatars.githubusercontent.com/u/23968?v=3","gravatar_id":"","url":"https://api.github.com/users/beatak","html_url":"https://github.com/beatak","followers_url":"https://api.github.com/users/beatak/followers","following_url":"https://api.github.com/users/beatak/following{/other_user}","gists_url":"https://api.github.com/users/beatak/gists{/gist_id}","starred_url":"https://api.github.com/users/beatak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beatak/subscriptions","organizations_url":"https://api.github.com/users/beatak/orgs","repos_url":"https://api.github.com/users/beatak/repos","events_url":"https://api.github.com/users/beatak/events{/privacy}","received_events_url":"https://api.github.com/users/beatak/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/avidw/redd/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-02-16T19:02:59Z","updated_at":"2015-02-16T22:27:52Z","closed_at":"2015-02-16T22:27:52Z","body":"I'm trying to test out like this:\r\n\r\n```\r\nr = Redd.it(:script, client_id, cient_secret, username, password)\r\nr.authorize!\r\n```\r\n\r\nThe call above will make a request to `/api/v1/access_token` with a request header like \r\n\r\n```\r\n{\r\n    \"User-Agent\": \"Redd/Ruby, v0.7.3\",\r\n    \"Authorization\": \"Basic …\"\r\n}\r\n```\r\n\r\nand a request body like \r\n\r\n```\r\n{\r\n    grant_type: \"password\",\r\n    username: \"…\",\r\n    password: \"…\"\r\n}\r\n```\r\n\r\nand I get this:\r\n\r\n```\r\nredd/lib/redd/response/raise_error.rb:12:in `on_complete': {:error=>\"invalid_grant\"} (Redd::Error::ExpiredCode)\r\n```\r\n\r\nI'm stuck and I'd appreciate if you could suggest me what I'm doing wrong. Thx!"},"comment":{"url":"https://api.github.com/repos/avidw/redd/issues/comments/74582234","html_url":"https://github.com/avidw/redd/issues/8#issuecomment-74582234","issue_url":"https://api.github.com/repos/avidw/redd/issues/8","id":74582234,"user":{"login":"beatak","id":23968,"avatar_url":"https://avatars.githubusercontent.com/u/23968?v=3","gravatar_id":"","url":"https://api.github.com/users/beatak","html_url":"https://github.com/beatak","followers_url":"https://api.github.com/users/beatak/followers","following_url":"https://api.github.com/users/beatak/following{/other_user}","gists_url":"https://api.github.com/users/beatak/gists{/gist_id}","starred_url":"https://api.github.com/users/beatak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beatak/subscriptions","organizations_url":"https://api.github.com/users/beatak/orgs","repos_url":"https://api.github.com/users/beatak/repos","events_url":"https://api.github.com/users/beatak/events{/privacy}","received_events_url":"https://api.github.com/users/beatak/received_events","type":"User","site_admin":false},"created_at":"2015-02-16T22:27:52Z","updated_at":"2015-02-16T22:27:52Z","body":"Okay, so I figure it. I'm using `dotenv` for storing a set of password, secret and such. And my password contained `…$xxx,…` and that got interpolated.  I'm so sorry for the hassle!\r\n\r\nOne suggest I could give here is that… maybe this error, you can return `Redd::Error::InvalidCredentials` instead of `Redd::Error::ExpiredCode`?"}}