{"action":"created","issue":{"url":"https://api.github.com/repos/swagger-api/swagger-ui/issues/1383","labels_url":"https://api.github.com/repos/swagger-api/swagger-ui/issues/1383/labels{/name}","comments_url":"https://api.github.com/repos/swagger-api/swagger-ui/issues/1383/comments","events_url":"https://api.github.com/repos/swagger-api/swagger-ui/issues/1383/events","html_url":"https://github.com/swagger-api/swagger-ui/issues/1383","id":89585306,"number":1383,"title":"OAuth2 application flow","user":{"login":"ksmithut","id":1906967,"avatar_url":"https://avatars.githubusercontent.com/u/1906967?v=3","gravatar_id":"","url":"https://api.github.com/users/ksmithut","html_url":"https://github.com/ksmithut","followers_url":"https://api.github.com/users/ksmithut/followers","following_url":"https://api.github.com/users/ksmithut/following{/other_user}","gists_url":"https://api.github.com/users/ksmithut/gists{/gist_id}","starred_url":"https://api.github.com/users/ksmithut/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ksmithut/subscriptions","organizations_url":"https://api.github.com/users/ksmithut/orgs","repos_url":"https://api.github.com/users/ksmithut/repos","events_url":"https://api.github.com/users/ksmithut/events{/privacy}","received_events_url":"https://api.github.com/users/ksmithut/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":null,"comments":13,"created_at":"2015-06-19T15:01:08Z","updated_at":"2015-12-18T20:08:39Z","closed_at":null,"body":"Please let me know if this is not the right place to ask this.\r\n\r\nI am trying to setup my swagger api to be accessible through swagger-ui, but I'm unable to find out how this is supposed to work.\r\n\r\nMy securityDefinitions in my json looks like this:\r\n\r\n```\r\n{\r\n  ...\r\n  \"securityDefinitions\": {\r\n    \"oauth2\": {\r\n      \"type\": \"oauth2\",\r\n      \"tokenUrl\": \"http://localhost:5100/oauth/token\",\r\n      \"flow\": \"application\",\r\n      \"scopes\": {\r\n        \"read\": \"read access\"\r\n      }\r\n    }\r\n  }\r\n}\r\n```\r\n\r\nWhen I attach the \"security\" property to an endpoint, I get the little on/off switch in the ui to turn on authentication. A dialog pops up with the \"read\" scope, I check the box and click on \"Authorize\". It seems to be trying to redirect to the \"authorizationUrl\", but that's not how the application flow works. According to [the spec](https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md#fixed-fields-15) the authorization url is not a requirement for the application flow, but the tokenUrl should be used. Am I doing something wrong?\r\n\r\nI'm not sure what information you need, but I'm using version 2.1.0 of swagger-ui and my swagger api is swagger 2.0 compliant. Let me know what other information you need."},"comment":{"url":"https://api.github.com/repos/swagger-api/swagger-ui/issues/comments/165887389","html_url":"https://github.com/swagger-api/swagger-ui/issues/1383#issuecomment-165887389","issue_url":"https://api.github.com/repos/swagger-api/swagger-ui/issues/1383","id":165887389,"user":{"login":"fehguy","id":249413,"avatar_url":"https://avatars.githubusercontent.com/u/249413?v=3","gravatar_id":"","url":"https://api.github.com/users/fehguy","html_url":"https://github.com/fehguy","followers_url":"https://api.github.com/users/fehguy/followers","following_url":"https://api.github.com/users/fehguy/following{/other_user}","gists_url":"https://api.github.com/users/fehguy/gists{/gist_id}","starred_url":"https://api.github.com/users/fehguy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fehguy/subscriptions","organizations_url":"https://api.github.com/users/fehguy/orgs","repos_url":"https://api.github.com/users/fehguy/repos","events_url":"https://api.github.com/users/fehguy/events{/privacy}","received_events_url":"https://api.github.com/users/fehguy/received_events","type":"User","site_admin":false},"created_at":"2015-12-18T20:08:39Z","updated_at":"2015-12-18T20:08:39Z","body":"thank you @TomDemeranville, I will test and give feedback or merge!"}}