{"action":"created","issue":{"url":"https://api.github.com/repos/thephpleague/oauth2-client/issues/363","labels_url":"https://api.github.com/repos/thephpleague/oauth2-client/issues/363/labels{/name}","comments_url":"https://api.github.com/repos/thephpleague/oauth2-client/issues/363/comments","events_url":"https://api.github.com/repos/thephpleague/oauth2-client/issues/363/events","html_url":"https://github.com/thephpleague/oauth2-client/pull/363","id":91806910,"number":363,"title":"Another proposed cleanup of getAccessToken","user":{"login":"rtheunissen","id":809191,"avatar_url":"https://avatars.githubusercontent.com/u/809191?v=3","gravatar_id":"","url":"https://api.github.com/users/rtheunissen","html_url":"https://github.com/rtheunissen","followers_url":"https://api.github.com/users/rtheunissen/followers","following_url":"https://api.github.com/users/rtheunissen/following{/other_user}","gists_url":"https://api.github.com/users/rtheunissen/gists{/gist_id}","starred_url":"https://api.github.com/users/rtheunissen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rtheunissen/subscriptions","organizations_url":"https://api.github.com/users/rtheunissen/orgs","repos_url":"https://api.github.com/users/rtheunissen/repos","events_url":"https://api.github.com/users/rtheunissen/events{/privacy}","received_events_url":"https://api.github.com/users/rtheunissen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-06-29T13:45:02Z","updated_at":"2015-06-29T13:57:11Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/thephpleague/oauth2-client/pulls/363","html_url":"https://github.com/thephpleague/oauth2-client/pull/363","diff_url":"https://github.com/thephpleague/oauth2-client/pull/363.diff","patch_url":"https://github.com/thephpleague/oauth2-client/pull/363.patch"},"body":"While updating the Reddit provider, I came across some cases where the current `getAccessToken` method is difficult to configure. I'll outline the changes here, but will comment inline with more detail.\r\n\r\n- Removed the request method constants.\r\n- Removed `testInvalidAccessTokenMethod`\r\n- Added `getAccessTokenUrl`\r\n- Added `getAccessTokenHeaders`\r\n- Added `getAccessTokenBody`\r\n- Added `getAccessTokenRequestOptions`\r\n- Fixed `prepareAccessTokenResponse` to also accept strings\r\n\r\nThese came up because:\r\n\r\n1. I have to add a `Content-Type: application/x-www-form-urlencoded` header when requesting a Reddit access token.\r\n2. I have to `urldecode` the request body because Reddit has a `grant_type` with forward slashes in it, which `http_build_query` automatically URL-encodes.\r\n3. Reddit requires Basic HTTP auth when requesting an access token."},"comment":{"url":"https://api.github.com/repos/thephpleague/oauth2-client/issues/comments/116670325","html_url":"https://github.com/thephpleague/oauth2-client/pull/363#issuecomment-116670325","issue_url":"https://api.github.com/repos/thephpleague/oauth2-client/issues/363","id":116670325,"user":{"login":"shadowhand","id":38203,"avatar_url":"https://avatars.githubusercontent.com/u/38203?v=3","gravatar_id":"","url":"https://api.github.com/users/shadowhand","html_url":"https://github.com/shadowhand","followers_url":"https://api.github.com/users/shadowhand/followers","following_url":"https://api.github.com/users/shadowhand/following{/other_user}","gists_url":"https://api.github.com/users/shadowhand/gists{/gist_id}","starred_url":"https://api.github.com/users/shadowhand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shadowhand/subscriptions","organizations_url":"https://api.github.com/users/shadowhand/orgs","repos_url":"https://api.github.com/users/shadowhand/repos","events_url":"https://api.github.com/users/shadowhand/events{/privacy}","received_events_url":"https://api.github.com/users/shadowhand/received_events","type":"User","site_admin":false},"created_at":"2015-06-29T13:57:11Z","updated_at":"2015-06-29T13:57:11Z","body":"I'm fairly sure that: a) these changes are not necessary, b) the functionality for sending form data already exists (but may be partially broken)."}}