{"action":"created","issue":{"url":"https://api.github.com/repos/zendesk/samson/issues/2654","repository_url":"https://api.github.com/repos/zendesk/samson","labels_url":"https://api.github.com/repos/zendesk/samson/issues/2654/labels{/name}","comments_url":"https://api.github.com/repos/zendesk/samson/issues/2654/comments","events_url":"https://api.github.com/repos/zendesk/samson/issues/2654/events","html_url":"https://github.com/zendesk/samson/issues/2654","id":306159501,"number":2654,"title":"redirect_uri_mismatch","user":{"login":"ivomarino","id":4869961,"avatar_url":"https://avatars2.githubusercontent.com/u/4869961?v=4","gravatar_id":"","url":"https://api.github.com/users/ivomarino","html_url":"https://github.com/ivomarino","followers_url":"https://api.github.com/users/ivomarino/followers","following_url":"https://api.github.com/users/ivomarino/following{/other_user}","gists_url":"https://api.github.com/users/ivomarino/gists{/gist_id}","starred_url":"https://api.github.com/users/ivomarino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ivomarino/subscriptions","organizations_url":"https://api.github.com/users/ivomarino/orgs","repos_url":"https://api.github.com/users/ivomarino/repos","events_url":"https://api.github.com/users/ivomarino/events{/privacy}","received_events_url":"https://api.github.com/users/ivomarino/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-03-17T14:12:39Z","updated_at":"2018-03-19T18:11:42Z","closed_at":null,"author_association":"NONE","body":"hi all, we're running Samson as a Docker container behind `HAProxy` which also does SSL termination, the service is available as, let's say, http://deploy.dev.foo.com -- the following environment settings have been set:\r\n\r\n```\r\n        DATABASE_URL: \"sqlite3://db/development.sqlite\"\r\n        DEFAULT_URL: \"https://deploy.dev.foo.com\"\r\n        SECRET_TOKEN: \"whatever\"\r\n        AUTH_GITHUB: \"true\"\r\n        GITHUB_TOKEN: \"whatever\"\r\n        GITHUB_ORGANIZATION: \"foo\"\r\n        GITHUB_ADMIN_TEAM: \"foo\"\r\n        GITHUB_CLIENT_ID: \"whatever\"\r\n        GITHUB_SECRET: \"whatever\"\r\n        # RAILS_ENV: \"production\"\r\n        # RACK_ENV: \"production\"\r\n        RAILS_ENV: \"development\"\r\n        RACK_ENV: \"development\"\r\n        FORCE_SSL: 1\r\n```\r\n\r\nafter trying to log-in via GitHub we always get this error message: `redirect_uri_mismatch | The redirect_uri MUST match the registered callback URL for this application. | https://developer.github.com/apps/managing-oauth-apps/troubleshooting-authorization-request-errors/#redirect-uri-mismatch`:\r\n\r\n<img width=\"1242\" alt=\"screen shot 2018-03-17 at 14 57 19\" src=\"https://user-images.githubusercontent.com/4869961/37556360-229f0c2e-29f5-11e8-8a0d-883a99f223db.png\">\r\n\r\nOAuth authentication has been set this way:\r\n\r\n<img width=\"596\" alt=\"screen shot 2018-03-17 at 15 11 34\" src=\"https://user-images.githubusercontent.com/4869961/37556401-96084482-29f5-11e8-88bf-7f3e9a547c24.png\">\r\n\r\nany suggestions? Thanks."},"comment":{"url":"https://api.github.com/repos/zendesk/samson/issues/comments/374312052","html_url":"https://github.com/zendesk/samson/issues/2654#issuecomment-374312052","issue_url":"https://api.github.com/repos/zendesk/samson/issues/2654","id":374312052,"user":{"login":"grosser","id":11367,"avatar_url":"https://avatars3.githubusercontent.com/u/11367?v=4","gravatar_id":"","url":"https://api.github.com/users/grosser","html_url":"https://github.com/grosser","followers_url":"https://api.github.com/users/grosser/followers","following_url":"https://api.github.com/users/grosser/following{/other_user}","gists_url":"https://api.github.com/users/grosser/gists{/gist_id}","starred_url":"https://api.github.com/users/grosser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grosser/subscriptions","organizations_url":"https://api.github.com/users/grosser/orgs","repos_url":"https://api.github.com/users/grosser/repos","events_url":"https://api.github.com/users/grosser/events{/privacy}","received_events_url":"https://api.github.com/users/grosser/received_events","type":"User","site_admin":false},"created_at":"2018-03-19T18:11:42Z","updated_at":"2018-03-19T18:11:42Z","author_association":"OWNER","body":"hmm I think the error comes from githubs side via oauth \r\nsee omniauth-oauth2-1.4.0/lib/omniauth/strategies/oauth2.rb:66\r\n\r\ndoes it work when only setting the callback url to http ?\r\n\r\nI think the issue comes from samson sending out a request like \"hey call me back on http://\" and then github say \"nope!\"\r\n\r\ncallback_url comes from omniauth-1.6.1/lib/omniauth/strategy.rb:410 \r\nso might be fixable by setting `OmniAuth.config.full_host = \"https://debug.dev.foo.com\"` in samsons `config/initializers/omniauth.rb`\r\n\r\nlet me know if that works ... might also be good to inspect the request env, it should be visible on that error page you saw ... check for HTTP_X_FORWARDED_PROTO "}}
{"actor":{"display_login":"grosser"}}