{"action":"created","issue":{"url":"https://api.github.com/repos/swagger-api/swagger-ui/issues/1171","labels_url":"https://api.github.com/repos/swagger-api/swagger-ui/issues/1171/labels{/name}","comments_url":"https://api.github.com/repos/swagger-api/swagger-ui/issues/1171/comments","events_url":"https://api.github.com/repos/swagger-api/swagger-ui/issues/1171/events","html_url":"https://github.com/swagger-api/swagger-ui/issues/1171","id":68851909,"number":1171,"title":"HTTP Basic Auth doesn't work in v2.1.0-M2","user":{"login":"r-brown","id":1361258,"avatar_url":"https://avatars.githubusercontent.com/u/1361258?v=3","gravatar_id":"","url":"https://api.github.com/users/r-brown","html_url":"https://github.com/r-brown","followers_url":"https://api.github.com/users/r-brown/followers","following_url":"https://api.github.com/users/r-brown/following{/other_user}","gists_url":"https://api.github.com/users/r-brown/gists{/gist_id}","starred_url":"https://api.github.com/users/r-brown/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/r-brown/subscriptions","organizations_url":"https://api.github.com/users/r-brown/orgs","repos_url":"https://api.github.com/users/r-brown/repos","events_url":"https://api.github.com/users/r-brown/events{/privacy}","received_events_url":"https://api.github.com/users/r-brown/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/swagger-api/swagger-ui/labels/Bug","name":"Bug","color":"e11d21"},{"url":"https://api.github.com/repos/swagger-api/swagger-ui/labels/P1","name":"P1","color":"5319e7"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/swagger-api/swagger-ui/milestones/2","html_url":"https://github.com/swagger-api/swagger-ui/milestones/v2.1","labels_url":"https://api.github.com/repos/swagger-api/swagger-ui/milestones/2/labels","id":795282,"number":2,"title":"v2.1","description":"Final release for 2.1.0, including support for:\r\n\r\nRemote model references\r\nToggle-able XML model support\r\nAutomatically generated authentication forms based on security schemes","creator":{"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},"open_issues":37,"closed_issues":49,"state":"open","created_at":"2014-09-19T04:07:28Z","updated_at":"2015-05-08T21:30:41Z","due_on":"2015-04-19T07:00:00Z","closed_at":null},"comments":14,"created_at":"2015-04-16T05:58:06Z","updated_at":"2015-05-08T21:37:12Z","closed_at":null,"body":"Hello,\r\n\r\nI'm trying to configure Swagger to use default demo account with HTTP Basic Auth.\r\n\r\nBelow is my index.html configuration:\r\n```html\r\n...\r\n            function addAuthorization() {\r\n                var username = $('#input_username').val();\r\n                var password = $('#input_password').val();\r\n                if (username && username.trim() != \"\" && password && password.trim() != \"\") {\r\n                    var basicAuth = new SwaggerClient.PasswordAuthorization('basic', username, password);\r\n                    window.swaggerUi.api.clientAuthorizations.add(\"basicAuth\", basicAuth);\r\n                }\r\n            }\r\n...\r\n```\r\nsource: https://github.com/Labs64/NetLicensing-API/blob/gh-pages/index.html\r\n\r\n... and JSON definition:\r\n```JSON\r\n...\r\n                \"security\": [\r\n                    {\r\n                        \"basicAuth\": []\r\n                    }\r\n                ]\r\n...\r\n    \"securityDefinitions\": {\r\n        \"basicAuth\": {\r\n            \"type\": \"basic\",\r\n            \"description\": \"HTTP Basic Authentication. Works over `HTTP` and `HTTPS`\"\r\n        }\r\n    },\r\n...\r\n```\r\nsource: https://github.com/Labs64/NetLicensing-API/blob/gh-pages/v2.0/netlicensing.json\r\n\r\nWith this configuration basicAuth header is not set and I'm always getting browser prompt dialog for credentials entry.\r\nCould you help me with this issue?\r\n\r\nLive version can be found here: http://io.labs64.com/NetLicensing-API/"},"comment":{"url":"https://api.github.com/repos/swagger-api/swagger-ui/issues/comments/100374999","html_url":"https://github.com/swagger-api/swagger-ui/issues/1171#issuecomment-100374999","issue_url":"https://api.github.com/repos/swagger-api/swagger-ui/issues/1171","id":100374999,"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-05-08T21:37:12Z","updated_at":"2015-05-08T21:37:12Z","body":"OK looks like a chicken  & egg problem.  You need to return a 200 for the OPTIONS request when calling your server.  That is required for seeing IF it can even send the `authorizations` header.  Once that's done, it should work."}}