{"action":"closed","issue":{"url":"https://api.github.com/repos/djchen/oauth2-fitbit/issues/12","repository_url":"https://api.github.com/repos/djchen/oauth2-fitbit","labels_url":"https://api.github.com/repos/djchen/oauth2-fitbit/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/djchen/oauth2-fitbit/issues/12/comments","events_url":"https://api.github.com/repos/djchen/oauth2-fitbit/issues/12/events","html_url":"https://github.com/djchen/oauth2-fitbit/issues/12","id":140498131,"number":12,"title":"Invalid authorization header","user":{"login":"ahpathy","id":17802849,"avatar_url":"https://avatars.githubusercontent.com/u/17802849?v=3","gravatar_id":"","url":"https://api.github.com/users/ahpathy","html_url":"https://github.com/ahpathy","followers_url":"https://api.github.com/users/ahpathy/followers","following_url":"https://api.github.com/users/ahpathy/following{/other_user}","gists_url":"https://api.github.com/users/ahpathy/gists{/gist_id}","starred_url":"https://api.github.com/users/ahpathy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ahpathy/subscriptions","organizations_url":"https://api.github.com/users/ahpathy/orgs","repos_url":"https://api.github.com/users/ahpathy/repos","events_url":"https://api.github.com/users/ahpathy/events{/privacy}","received_events_url":"https://api.github.com/users/ahpathy/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-03-13T15:47:29Z","updated_at":"2016-03-13T20:26:03Z","closed_at":"2016-03-13T20:26:02Z","body":"When using the library to authorize my application with Fitbit, I get the following error displayed after callback (the callback page is the same URL as the page calling the example code from README):\r\n\r\n\"invalid_client: Invalid authorization header. Client secret invalid. Visit https://dev.fitbit.com/docs/oauth2 for more information on the Fitbit Web API authorization process.\"\r\n\r\nThe error is generated by this code:\r\n\r\n // Try to get an access token using the authorization code grant.\r\n        $accessToken = $provider->getAccessToken('authorization_code', [\r\n            'code' => $_GET['code']\r\n        ]);\r\n\r\nThe callback URL looks like this: \"test.php?state=otrqVmQ3lvKQdiXxV8YVO5HyJQCwGvmj&code=40354c250f865fb45232ac1f3d1f6162083dae0f\" so isset($_GET['code']) is true and so that try statement is attempted. I'm just using the example code provided in the README, changing only the client ID, client secret, and the callback URL (test.php is both the entry page for this test and the callback URL). \r\n\r\nI read (https://twittercommunity.com/t/puzzling-invalid-authorization-header-error-when-working-with-update-with-media/331) that maybe the client library was missing a URL encoding for the headers. Seems unlikely, but instead of trying to figure out what I'm doing wrong I was hoping you could help?!\r\n\r\n"}}