{"action":"created","issue":{"url":"https://api.github.com/repos/brendanhay/gogol/issues/6","labels_url":"https://api.github.com/repos/brendanhay/gogol/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/brendanhay/gogol/issues/6/comments","events_url":"https://api.github.com/repos/brendanhay/gogol/issues/6/events","html_url":"https://github.com/brendanhay/gogol/issues/6","id":113250110,"number":6,"title":"FromFile Credentials not working with service_account type","user":{"login":"rrnewton","id":274582,"avatar_url":"https://avatars.githubusercontent.com/u/274582?v=3","gravatar_id":"","url":"https://api.github.com/users/rrnewton","html_url":"https://github.com/rrnewton","followers_url":"https://api.github.com/users/rrnewton/followers","following_url":"https://api.github.com/users/rrnewton/following{/other_user}","gists_url":"https://api.github.com/users/rrnewton/gists{/gist_id}","starred_url":"https://api.github.com/users/rrnewton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rrnewton/subscriptions","organizations_url":"https://api.github.com/users/rrnewton/orgs","repos_url":"https://api.github.com/users/rrnewton/repos","events_url":"https://api.github.com/users/rrnewton/events{/privacy}","received_events_url":"https://api.github.com/users/rrnewton/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-25T20:29:17Z","updated_at":"2015-10-25T22:33:46Z","closed_at":null,"body":"gogol is fantastically exciting!  (But trying to stumble through OAuth is painful... can the core `gogol` lib walk us through this a bit more for newbies?)\r\n\r\nHere's my current stumbling block.  Currently the docs on the `Credentials` data type say that its ok to use \"service_account\" credentials:\r\n\r\n```\r\nLoad the Application Default Credentials from a specific file path. The file can be formatted as either a service_account or an authorized_user.\r\n```\r\n\r\nOk, so I followed Google's [instructions for \"Application Default Credentials\"](https://developers.google.com/identity/protocols/application-default-credentials), and got a json file with a private key in it, which says it is in fact of type \"service_account\".  Specifically, it's of the form:\r\n\r\n```\r\n{\r\n  \"private_key_id\": \"...\",\r\n  \"private_key\": \"...\",\r\n  \"client_email\": \"...@developer.gserviceaccount.com\",\r\n  \"client_id\": \"....apps.googleusercontent.com\",\r\n  \"type\": \"service_account\"\r\n}\r\n```\r\n\r\nThen for my `Credentials` data type I point it at this file with `FromFile \"blah.json\"`.  But when trying to execute `newEnv` I get this error:\r\n\r\n```\r\nmytest-exe: InvalidFileError \"blah.json\" \"key \\\"client_secret\\\" not present\"\r\n```\r\n\r\nHmm, that looks like it's trying to use the other form of credentials, not the \"service_account\" type...\r\n\r\nCC @craigcitro"},"comment":{"url":"https://api.github.com/repos/brendanhay/gogol/issues/comments/150980566","html_url":"https://github.com/brendanhay/gogol/issues/6#issuecomment-150980566","issue_url":"https://api.github.com/repos/brendanhay/gogol/issues/6","id":150980566,"user":{"login":"rrnewton","id":274582,"avatar_url":"https://avatars.githubusercontent.com/u/274582?v=3","gravatar_id":"","url":"https://api.github.com/users/rrnewton","html_url":"https://github.com/rrnewton","followers_url":"https://api.github.com/users/rrnewton/followers","following_url":"https://api.github.com/users/rrnewton/following{/other_user}","gists_url":"https://api.github.com/users/rrnewton/gists{/gist_id}","starred_url":"https://api.github.com/users/rrnewton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rrnewton/subscriptions","organizations_url":"https://api.github.com/users/rrnewton/orgs","repos_url":"https://api.github.com/users/rrnewton/repos","events_url":"https://api.github.com/users/rrnewton/events{/privacy}","received_events_url":"https://api.github.com/users/rrnewton/received_events","type":"User","site_admin":false},"created_at":"2015-10-25T22:33:46Z","updated_at":"2015-10-25T22:33:46Z","body":"Reading through the code a bit, and it looks like this json file should match the `FromJSON` instance for `ServiceAccount`.  And yet we seem to be getting an error from the `AuthorisedUser` parse.  It's almost as though the disjunction isn't working right here:\r\n\r\n```Haskell\r\ninstance FromJSON Parse where\r\n    parseJSON o = SA <$> parseJSON o <|> AU <$> parseJSON o\r\n```\r\n\r\n"}}