{"action":"created","issue":{"url":"https://api.github.com/repos/Shopify/omniauth-shopify-oauth2/issues/38","repository_url":"https://api.github.com/repos/Shopify/omniauth-shopify-oauth2","labels_url":"https://api.github.com/repos/Shopify/omniauth-shopify-oauth2/issues/38/labels{/name}","comments_url":"https://api.github.com/repos/Shopify/omniauth-shopify-oauth2/issues/38/comments","events_url":"https://api.github.com/repos/Shopify/omniauth-shopify-oauth2/issues/38/events","html_url":"https://github.com/Shopify/omniauth-shopify-oauth2/pull/38","id":134683404,"number":38,"title":"Whitespace mismatch causes scope failure.","user":{"login":"averydev","id":477027,"avatar_url":"https://avatars.githubusercontent.com/u/477027?v=3","gravatar_id":"","url":"https://api.github.com/users/averydev","html_url":"https://github.com/averydev","followers_url":"https://api.github.com/users/averydev/followers","following_url":"https://api.github.com/users/averydev/following{/other_user}","gists_url":"https://api.github.com/users/averydev/gists{/gist_id}","starred_url":"https://api.github.com/users/averydev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/averydev/subscriptions","organizations_url":"https://api.github.com/users/averydev/orgs","repos_url":"https://api.github.com/users/averydev/repos","events_url":"https://api.github.com/users/averydev/events{/privacy}","received_events_url":"https://api.github.com/users/averydev/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-02-18T20:15:29Z","updated_at":"2016-02-22T19:39:37Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Shopify/omniauth-shopify-oauth2/pulls/38","html_url":"https://github.com/Shopify/omniauth-shopify-oauth2/pull/38","diff_url":"https://github.com/Shopify/omniauth-shopify-oauth2/pull/38.diff","patch_url":"https://github.com/Shopify/omniauth-shopify-oauth2/pull/38.patch"},"body":"With multiple scope params, the params[:scope] comes pre-cleaned of whitespace, so no changes to the config will propagate to this step. The token['scope'] however, includes whitespace. This causes a failure for > 1 scope regardless of validity. \r\n\r\nDocumentation is unclear / conflicting as to whether whitespace should be included in the scopes list, nor is it a meaningful distinction that should fail a validity test.  "},"comment":{"url":"https://api.github.com/repos/Shopify/omniauth-shopify-oauth2/issues/comments/187340942","html_url":"https://github.com/Shopify/omniauth-shopify-oauth2/pull/38#issuecomment-187340942","issue_url":"https://api.github.com/repos/Shopify/omniauth-shopify-oauth2/issues/38","id":187340942,"user":{"login":"averydev","id":477027,"avatar_url":"https://avatars.githubusercontent.com/u/477027?v=3","gravatar_id":"","url":"https://api.github.com/users/averydev","html_url":"https://github.com/averydev","followers_url":"https://api.github.com/users/averydev/followers","following_url":"https://api.github.com/users/averydev/following{/other_user}","gists_url":"https://api.github.com/users/averydev/gists{/gist_id}","starred_url":"https://api.github.com/users/averydev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/averydev/subscriptions","organizations_url":"https://api.github.com/users/averydev/orgs","repos_url":"https://api.github.com/users/averydev/repos","events_url":"https://api.github.com/users/averydev/events{/privacy}","received_events_url":"https://api.github.com/users/averydev/received_events","type":"User","site_admin":false},"created_at":"2016-02-22T19:39:37Z","updated_at":"2016-02-22T19:39:37Z","body":"Precisely.  However, it's not an all the time thing. My dev app was working fine, and then it wasn't. I tracked the issue down to the space problem, fixed it locally with this pull. Then the response switched back from\r\n`\"read_products, write_product\"` to `\"read_products,write_product\"`.\r\n\r\nI'm not sure why it changed, but it wasted a couple hours of my day, so I think it's better to not rely on the presence / absence of whitespace in the scope."}}