{"action":"created","issue":{"url":"https://api.github.com/repos/swagger-api/swagger-ui/issues/807","labels_url":"https://api.github.com/repos/swagger-api/swagger-ui/issues/807/labels{/name}","comments_url":"https://api.github.com/repos/swagger-api/swagger-ui/issues/807/comments","events_url":"https://api.github.com/repos/swagger-api/swagger-ui/issues/807/events","html_url":"https://github.com/swagger-api/swagger-ui/issues/807","id":53472765,"number":807,"title":"Oauth2 password flow","user":{"login":"reginald-louis","id":10109403,"avatar_url":"https://avatars.githubusercontent.com/u/10109403?v=3","gravatar_id":"","url":"https://api.github.com/users/reginald-louis","html_url":"https://github.com/reginald-louis","followers_url":"https://api.github.com/users/reginald-louis/followers","following_url":"https://api.github.com/users/reginald-louis/following{/other_user}","gists_url":"https://api.github.com/users/reginald-louis/gists{/gist_id}","starred_url":"https://api.github.com/users/reginald-louis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reginald-louis/subscriptions","organizations_url":"https://api.github.com/users/reginald-louis/orgs","repos_url":"https://api.github.com/users/reginald-louis/repos","events_url":"https://api.github.com/users/reginald-louis/events{/privacy}","received_events_url":"https://api.github.com/users/reginald-louis/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/swagger-api/swagger-ui/labels/Feature","name":"Feature","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/swagger-api/swagger-ui/milestones/11","html_url":"https://github.com/swagger-api/swagger-ui/milestones/v2.1.4","labels_url":"https://api.github.com/repos/swagger-api/swagger-ui/milestones/11/labels","id":1285638,"number":11,"title":"v2.1.4","description":"","creator":{"login":"webron","id":241629,"avatar_url":"https://avatars.githubusercontent.com/u/241629?v=3","gravatar_id":"","url":"https://api.github.com/users/webron","html_url":"https://github.com/webron","followers_url":"https://api.github.com/users/webron/followers","following_url":"https://api.github.com/users/webron/following{/other_user}","gists_url":"https://api.github.com/users/webron/gists{/gist_id}","starred_url":"https://api.github.com/users/webron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/webron/subscriptions","organizations_url":"https://api.github.com/users/webron/orgs","repos_url":"https://api.github.com/users/webron/repos","events_url":"https://api.github.com/users/webron/events{/privacy}","received_events_url":"https://api.github.com/users/webron/received_events","type":"User","site_admin":false},"open_issues":31,"closed_issues":0,"state":"open","created_at":"2015-09-02T06:46:11Z","updated_at":"2015-09-02T06:46:53Z","due_on":null,"closed_at":null},"comments":14,"created_at":"2015-01-06T02:09:35Z","updated_at":"2015-11-06T11:25:37Z","closed_at":null,"body":"Hi. I'm trying to use the oauth2 feature with password flow from swagger 2.0 spec. I dont' know if I'm doing thing wrong or if there some missing stuff, but let me explain. This is my spec:\r\n\r\n```\r\nswagger: '2.0'\r\n\r\ninfo:\r\n  title: BakPak API\r\n  description: BakPak server API\r\n  version: '1.0.0'\r\n\r\nhost: localhost:5000\r\nbasePath: /api/v1\r\n\r\nschemes:\r\n  - http\r\n  - https\r\n\r\nconsumes:\r\n  - application/json\r\n\r\nproduces:\r\n  - application/json\r\n\r\nsecurityDefinitions:\r\n  basicPassword:\r\n    type: oauth2\r\n    flow: password\r\n    tokenUrl: http://localhost:5000/api/v1/token\r\n    scopes:\r\n      s1: Scope 1\r\n      s2: Scope 2\r\n    \r\npaths:\r\n  /token:\r\n    get:\r\n      tags:\r\n        - auth\r\n      summary: Get an authentication token\r\n      description: Get an authentication token\r\n      operationId: GetToken\r\n      responses:\r\n        '200':\r\n          description: \"\"\r\n        default:\r\n          description: Operation failed.\r\n  /test:\r\n    get:\r\n      summary: Test endpoint\r\n      description: Test endpoint\r\n      responses:\r\n        '200':\r\n          description: \"\"\r\n        default:\r\n          description: Operation failed.\r\n      security:\r\n        - basicPassword:\r\n          - s1\r\n          - s2  \r\n  /user:\r\n    post:\r\n      tags:\r\n        - user\r\n      summary: Add a user\r\n      description: Add a user\r\n      operationId: AddUser\r\n      parameters:\r\n        - name: body\r\n          in: body\r\n          description: Type can be `bp`, `facebook` or `google`.\r\n          schema:\r\n            $ref: '#/definitions/Credentials'\r\n      responses:\r\n        '200':\r\n          description: \"\"\r\n        default:\r\n          description: Operation failed.\r\n          \r\ndefinitions:\r\n  Credentials:\r\n    properties:\r\n      type:\r\n        type: string\r\n      username:\r\n        type: string\r\n      password:\r\n        type: string\r\n      token:\r\n        type: string\r\n```\r\n\r\nI have a `/test` endpoint just to test oauth2. I remove the comment in `index.html` to enable oauth2 flow:\r\n```\r\n            initOAuth({\r\n              clientId: \"your-client-id\",\r\n              realm: \"your-realms\",\r\n              appName: \"your-app-name\"\r\n            });\r\n```\r\n\r\nWhen I click on the **\"on/off\"** button to authorize, a new windows browser is opened with the following url `http://localhost:5000/swagger-ui/null&redirect_uri=http://localhost:5000/swagger-ui/o2c.html&realm=your-realms&client_id=your-client-id&scope=s1,s2`.\r\n\r\nNote the `null` in the url. It is normal? I'm not super familiar with every aspect of oauth, but I was expecting a popup for username/password and somehow receiving at some endpoint a `POST` with a \r\n`application/x-www-form-urlencoded` in the request body like this:\r\n`grant_type=password&username=johndoe&password=A3ddj3w`\r\n\r\nreference: http://tools.ietf.org/html/rfc6749#section-4.3.2"},"comment":{"url":"https://api.github.com/repos/swagger-api/swagger-ui/issues/comments/154386274","html_url":"https://github.com/swagger-api/swagger-ui/issues/807#issuecomment-154386274","issue_url":"https://api.github.com/repos/swagger-api/swagger-ui/issues/807","id":154386274,"user":{"login":"mundodojava","id":1953589,"avatar_url":"https://avatars.githubusercontent.com/u/1953589?v=3","gravatar_id":"","url":"https://api.github.com/users/mundodojava","html_url":"https://github.com/mundodojava","followers_url":"https://api.github.com/users/mundodojava/followers","following_url":"https://api.github.com/users/mundodojava/following{/other_user}","gists_url":"https://api.github.com/users/mundodojava/gists{/gist_id}","starred_url":"https://api.github.com/users/mundodojava/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mundodojava/subscriptions","organizations_url":"https://api.github.com/users/mundodojava/orgs","repos_url":"https://api.github.com/users/mundodojava/repos","events_url":"https://api.github.com/users/mundodojava/events{/privacy}","received_events_url":"https://api.github.com/users/mundodojava/received_events","type":"User","site_admin":false},"created_at":"2015-11-06T11:25:37Z","updated_at":"2015-11-06T11:25:37Z","body":"Which branch I can fork to work?"}}