{"action":"created","issue":{"url":"https://api.github.com/repos/swagger-api/swagger-ui/issues/4213","repository_url":"https://api.github.com/repos/swagger-api/swagger-ui","labels_url":"https://api.github.com/repos/swagger-api/swagger-ui/issues/4213/labels{/name}","comments_url":"https://api.github.com/repos/swagger-api/swagger-ui/issues/4213/comments","events_url":"https://api.github.com/repos/swagger-api/swagger-ui/issues/4213/events","html_url":"https://github.com/swagger-api/swagger-ui/pull/4213","id":296239538,"number":4213,"title":"fix: add client_id and client_secret to form when type is request-body","user":{"login":"scottohara","id":289327,"avatar_url":"https://avatars3.githubusercontent.com/u/289327?v=4","gravatar_id":"","url":"https://api.github.com/users/scottohara","html_url":"https://github.com/scottohara","followers_url":"https://api.github.com/users/scottohara/followers","following_url":"https://api.github.com/users/scottohara/following{/other_user}","gists_url":"https://api.github.com/users/scottohara/gists{/gist_id}","starred_url":"https://api.github.com/users/scottohara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scottohara/subscriptions","organizations_url":"https://api.github.com/users/scottohara/orgs","repos_url":"https://api.github.com/users/scottohara/repos","events_url":"https://api.github.com/users/scottohara/events{/privacy}","received_events_url":"https://api.github.com/users/scottohara/received_events","type":"User","site_admin":false},"labels":[{"id":778147186,"url":"https://api.github.com/repos/swagger-api/swagger-ui/labels/status:%20on%20hold","name":"status: on hold","color":"fbca04","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-02-12T00:00:10Z","updated_at":"2018-05-05T19:35:48Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/swagger-api/swagger-ui/pulls/4213","html_url":"https://github.com/swagger-api/swagger-ui/pull/4213","diff_url":"https://github.com/swagger-api/swagger-ui/pull/4213.diff","patch_url":"https://github.com/swagger-api/swagger-ui/pull/4213.patch"},"body":"<!--- Provide a general summary of your changes in the Title above -->\r\nIn an OAuth2 password flow, when the type is `request-body`, the `client_id` and `client_secret` were being passed in an `Authorization` header and not in the request body.\r\n\r\n### Description\r\n<!--- Describe your changes in detail -->\r\nRefactored the `authorizePassword` function to properly handle the `request-body` case.\r\n\r\n### Motivation and Context\r\n<!--- Why is this change required? What problem does it solve? -->\r\n<!--- If it fixes an open issue, please link to the issue here. -->\r\n<!--- Use the magic \"Fixes #1234\" format, so the issues are -->\r\n<!--- automatically closed when this PR is merged. -->\r\nFixes #4192 \r\n\r\n### How Has This Been Tested?\r\n<!--- Please describe in detail how you manually tested your changes. -->\r\n<!--- Include details of your testing environment, and the tests you ran to -->\r\n<!--- see how your change affects other areas of the code, etc. -->\r\n\r\n1. Load the following sample API definition into Swagger UI: http://flask-restplus-example-server.herokuapp.com/api/v1/swagger.json\r\n2. Click the Authorize button\r\n3. Enter a username/password/client ID/client secret\r\n4. Ensure that the type is set to Request Body\r\n5. Click the Authorize button  (note: the actual authorization will fail, but for the purposes of this PR it is not an issue)\r\n6. Open the DevTools Network panel and check the form data in the request includes the username/password/client ID/client secret (see screenshot below)\r\n\r\n### Screenshots (if appropriate):\r\n![swagger_ui_and_actions_js_ _swagger-ui](https://user-images.githubusercontent.com/289327/36080392-8b1b5b9e-0fe3-11e8-8527-bd2958ffd866.png)\r\n\r\n## Checklist\r\n<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->\r\n<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->\r\n\r\n### My PR contains... \r\n<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->\r\n- [ ] No code changes (`src/` is unmodified: changes to documentation, CI, metadata, etc.)\r\n- [ ] Dependency changes (any modification to dependencies in `package.json`)\r\n- [x] Bug fixes (non-breaking change which fixes an issue)\r\n- [ ] Improvements (misc. changes to existing features)\r\n- [ ] Features (non-breaking change which adds functionality)\r\n\r\n### My changes...\r\n- [ ] are breaking changes to a public API (config options, System API, major UI change, etc).\r\n- [ ] are breaking changes to a private API (Redux, component props, utility functions, etc.).\r\n- [ ] are breaking changes to a developer API (npm script behavior changes, new dev system dependencies, etc).\r\n- [x] are not breaking changes.\r\n\r\n### Documentation\r\n- [x] My changes do not require a change to the project documentation.\r\n- [ ] My changes require a change to the project documentation.\r\n- [ ] If yes to above: I have updated the documentation accordingly.\r\n\r\n### Automated tests\r\n- [ ] My changes can not or do not need to be tested.\r\n- [ ] My changes can and should be tested by unit and/or integration tests.\r\n- [ ] If yes to above: I have added tests to cover my changes.\r\n- [ ] If yes to above: I have taken care to cover edge cases in my tests.\r\n- [x] All new and existing tests passed.\r\n"},"comment":{"url":"https://api.github.com/repos/swagger-api/swagger-ui/issues/comments/386829573","html_url":"https://github.com/swagger-api/swagger-ui/pull/4213#issuecomment-386829573","issue_url":"https://api.github.com/repos/swagger-api/swagger-ui/issues/4213","id":386829573,"user":{"login":"heldersepu","id":545474,"avatar_url":"https://avatars0.githubusercontent.com/u/545474?v=4","gravatar_id":"","url":"https://api.github.com/users/heldersepu","html_url":"https://github.com/heldersepu","followers_url":"https://api.github.com/users/heldersepu/followers","following_url":"https://api.github.com/users/heldersepu/following{/other_user}","gists_url":"https://api.github.com/users/heldersepu/gists{/gist_id}","starred_url":"https://api.github.com/users/heldersepu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heldersepu/subscriptions","organizations_url":"https://api.github.com/users/heldersepu/orgs","repos_url":"https://api.github.com/users/heldersepu/repos","events_url":"https://api.github.com/users/heldersepu/events{/privacy}","received_events_url":"https://api.github.com/users/heldersepu/received_events","type":"User","site_admin":false},"created_at":"2018-05-05T19:35:48Z","updated_at":"2018-05-05T19:35:48Z","author_association":"CONTRIBUTOR","body":"@ThomHurks\r\nCan you help adding some unit tests?"}}
{"actor":{"display_login":"heldersepu"}}