{"action":"created","issue":{"url":"https://api.github.com/repos/gate-sso/gate/issues/14","repository_url":"https://api.github.com/repos/gate-sso/gate","labels_url":"https://api.github.com/repos/gate-sso/gate/issues/14/labels{/name}","comments_url":"https://api.github.com/repos/gate-sso/gate/issues/14/comments","events_url":"https://api.github.com/repos/gate-sso/gate/issues/14/events","html_url":"https://github.com/gate-sso/gate/issues/14","id":247095793,"number":14,"title":"Invalid client","user":{"login":"seren","id":512022,"avatar_url":"https://avatars2.githubusercontent.com/u/512022?v=4","gravatar_id":"","url":"https://api.github.com/users/seren","html_url":"https://github.com/seren","followers_url":"https://api.github.com/users/seren/followers","following_url":"https://api.github.com/users/seren/following{/other_user}","gists_url":"https://api.github.com/users/seren/gists{/gist_id}","starred_url":"https://api.github.com/users/seren/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seren/subscriptions","organizations_url":"https://api.github.com/users/seren/orgs","repos_url":"https://api.github.com/users/seren/repos","events_url":"https://api.github.com/users/seren/events{/privacy}","received_events_url":"https://api.github.com/users/seren/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-08-01T14:50:30Z","updated_at":"2017-08-01T19:35:48Z","closed_at":"2017-08-01T19:35:48Z","body":"Hi, I'm running Gate in a docker-compose setup, and am getting this error in the logs when going through the Oauth flow:\r\n```\r\nweb_1    | I, [2017-07-31T23:46:17.484000 #1]  INFO -- omniauth: (google_oauth2) Request phase initiated.\r\nweb_1    | I, [2017-07-31T23:46:17.792000 #1]  INFO -- omniauth: (google_oauth2) Request phase initiated.\r\nweb_1    | I, [2017-07-31T23:46:20.194000 #1]  INFO -- omniauth: (google_oauth2) Callback phase initiated.\r\nweb_1    | E, [2017-07-31T23:46:21.062000 #1] ERROR -- omniauth: (google_oauth2) Authentication failure! invalid_credentials: OAuth2::Error, invalid_client:\r\nweb_1    | {\r\nweb_1    |   \"error\" : \"invalid_client\"\r\nweb_1    | }\r\n```\r\nI initially had the Oauth credentials set up like this:\r\n```\r\n# GATE_OAUTH_API_KEY == API key\r\n# GATE_OAUTH_CLIENT_KEY == Oauth client id\r\n# GATE_OAUTH_SECRET == Oauth client secret\r\n```\r\n\r\nwhich caused an immediate 401 from Google stating:\r\n```\r\nError: invalid_client\r\nThe OAuth client was not found.\r\n```\r\n\r\nSwapping the API and Client id/key like so:\r\n```\r\n# GATE_OAUTH_CLIENT_KEY == API key\r\n# GATE_OAUTH_API_KEY == Oauth client id\r\n# GATE_OAUTH_SECRET == Oauth client secret\r\n```\r\ngot me to the point where I could choose a google account to authenticate with, but since I'm now getting an `invalid_credentials` error, maybe that was the wrong solution.\r\nIt's also possible I need to enable additional APIs in the developer console, but that's just a guess.\r\n\r\nThis is my current `.env` file (with invalidated credentials):\r\n```\r\nGATE_OAUTH_CLIENT_KEY=AIzaSyAmRtqnY5mnD2lwvbitQfRijDNOJ34aJCY\r\nGATE_OAUTH_API_KEY=576456017342-jv90rsogj1btmudba64eol381ropol8u.apps.googleusercontent.com\r\nGATE_OAUTH_SECRET=D5_7ZnYl9AwJcWtDYO2FxLwm\r\nGATE_HOSTED_DOMAIN=mydomain.com\r\nGATE_SERVER_URL=gate.mydomain.com\r\nGATE_CONFIG_SECRET=thisismygatessosecret\r\nGATE_EMAIL_DOMAIN=mydomain.com\r\n```\r\n\r\nDo you know what would be causing these `invalid_client` errors with the credentials in swapped or non-swapped order? Thanks."},"comment":{"url":"https://api.github.com/repos/gate-sso/gate/issues/comments/319473741","html_url":"https://github.com/gate-sso/gate/issues/14#issuecomment-319473741","issue_url":"https://api.github.com/repos/gate-sso/gate/issues/14","id":319473741,"user":{"login":"seren","id":512022,"avatar_url":"https://avatars2.githubusercontent.com/u/512022?v=4","gravatar_id":"","url":"https://api.github.com/users/seren","html_url":"https://github.com/seren","followers_url":"https://api.github.com/users/seren/followers","following_url":"https://api.github.com/users/seren/following{/other_user}","gists_url":"https://api.github.com/users/seren/gists{/gist_id}","starred_url":"https://api.github.com/users/seren/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seren/subscriptions","organizations_url":"https://api.github.com/users/seren/orgs","repos_url":"https://api.github.com/users/seren/repos","events_url":"https://api.github.com/users/seren/events{/privacy}","received_events_url":"https://api.github.com/users/seren/received_events","type":"User","site_admin":false},"created_at":"2017-08-01T19:35:48Z","updated_at":"2017-08-01T19:35:48Z","body":"It seems that the problem may have been a combination of:\r\n* Swapped credentials getting cached in the app or db\r\n* Google project name scheme\r\nAfter blowing away the docker environment completely and regenerating the google project, things seem to be working. I'll submit a PR for the .env issue."}}
{"actor":{"display_login":"seren"}}