{"action":"created","issue":{"url":"https://api.github.com/repos/ropiku/omniauth-instagram/issues/22","repository_url":"https://api.github.com/repos/ropiku/omniauth-instagram","labels_url":"https://api.github.com/repos/ropiku/omniauth-instagram/issues/22/labels{/name}","comments_url":"https://api.github.com/repos/ropiku/omniauth-instagram/issues/22/comments","events_url":"https://api.github.com/repos/ropiku/omniauth-instagram/issues/22/events","html_url":"https://github.com/ropiku/omniauth-instagram/pull/22","id":116292524,"number":22,"title":"Remove query_string from callback_url.","user":{"login":"siong1987","id":5866,"avatar_url":"https://avatars.githubusercontent.com/u/5866?v=3","gravatar_id":"","url":"https://api.github.com/users/siong1987","html_url":"https://github.com/siong1987","followers_url":"https://api.github.com/users/siong1987/followers","following_url":"https://api.github.com/users/siong1987/following{/other_user}","gists_url":"https://api.github.com/users/siong1987/gists{/gist_id}","starred_url":"https://api.github.com/users/siong1987/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/siong1987/subscriptions","organizations_url":"https://api.github.com/users/siong1987/orgs","repos_url":"https://api.github.com/users/siong1987/repos","events_url":"https://api.github.com/users/siong1987/events{/privacy}","received_events_url":"https://api.github.com/users/siong1987/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-11-11T09:00:55Z","updated_at":"2016-03-22T14:31:24Z","closed_at":"2015-11-17T13:17:29Z","pull_request":{"url":"https://api.github.com/repos/ropiku/omniauth-instagram/pulls/22","html_url":"https://github.com/ropiku/omniauth-instagram/pull/22","diff_url":"https://github.com/ropiku/omniauth-instagram/pull/22.diff","patch_url":"https://github.com/ropiku/omniauth-instagram/pull/22.patch"},"body":"For some reasons, Instagram decided not to accept `query_string` as part of the `redirect_uri` in their oauth2's `https://api.instagram.com/oauth/access_token` request.\r\n\r\nInstagram should probably be the one to fix this since their documentation clearly states that extra parameters can be passed along and it can still be valid: https://instagram.com/developer/authentication/."},"comment":{"url":"https://api.github.com/repos/ropiku/omniauth-instagram/issues/comments/199840036","html_url":"https://github.com/ropiku/omniauth-instagram/pull/22#issuecomment-199840036","issue_url":"https://api.github.com/repos/ropiku/omniauth-instagram/issues/22","id":199840036,"user":{"login":"avokhmin","id":422109,"avatar_url":"https://avatars.githubusercontent.com/u/422109?v=3","gravatar_id":"","url":"https://api.github.com/users/avokhmin","html_url":"https://github.com/avokhmin","followers_url":"https://api.github.com/users/avokhmin/followers","following_url":"https://api.github.com/users/avokhmin/following{/other_user}","gists_url":"https://api.github.com/users/avokhmin/gists{/gist_id}","starred_url":"https://api.github.com/users/avokhmin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avokhmin/subscriptions","organizations_url":"https://api.github.com/users/avokhmin/orgs","repos_url":"https://api.github.com/users/avokhmin/repos","events_url":"https://api.github.com/users/avokhmin/events{/privacy}","received_events_url":"https://api.github.com/users/avokhmin/received_events","type":"User","site_admin":false},"created_at":"2016-03-22T14:31:24Z","updated_at":"2016-03-22T14:31:24Z","body":"ah, I see, the problem is here:\r\n\r\n[build_access_token](https://github.com/intridea/omniauth-oauth2/blob/v1.4.0/lib/omniauth/strategies/oauth2.rb#L87-L90)\r\n\r\nand we have:\r\n\r\n```\r\nAuthentication failure! invalid_credentials: OAuth2::Error, :\r\n{\"code\": 400, \"error_type\": \"OAuthException\", \"error_message\": \"Redirect URI doesn't match original redirect URI\"}\r\n```\r\n\r\nmaybe better to add some hook and new option to define: which parameters are allowed for `#build_access_token `?\r\n"}}