Closed
Description
Hello,
I'm trying to configure Swagger to use default demo account with HTTP Basic Auth.
Below is my index.html configuration:
...
function addAuthorization() {
var username = $('#input_username').val();
var password = $('#input_password').val();
if (username && username.trim() != "" && password && password.trim() != "") {
var basicAuth = new SwaggerClient.PasswordAuthorization('basic', username, password);
window.swaggerUi.api.clientAuthorizations.add("basicAuth", basicAuth);
}
}
...
source: https://github.com/Labs64/NetLicensing-API/blob/gh-pages/index.html
... and JSON definition:
...
"security": [
{
"basicAuth": []
}
]
...
"securityDefinitions": {
"basicAuth": {
"type": "basic",
"description": "HTTP Basic Authentication. Works over `HTTP` and `HTTPS`"
}
},
...
source: https://github.com/Labs64/NetLicensing-API/blob/gh-pages/v2.0/netlicensing.json
With this configuration basicAuth header is not set and I'm always getting browser prompt dialog for credentials entry.
Could you help me with this issue?
Live version can be found here: http://io.labs64.com/NetLicensing-API/