BasicAuth Header
Adding the Authorization Header (or any other security header) seems broken in v2.1.13 (and other versions). This is what I do:
var client = new SwaggerClient({
url: myUrl,
success: function () {
client.someMethod();
},
authorizations : {
easyapi_basic: new SwaggerClient.PasswordAuthorization('user', 'pass'),
},
});
There is a proper "Authorization:Basic dXNlcjpwYXNz" in the header when retrieving myUrl. Later, when when calling the someMethod() there is no "Authorization:" header present.
If your definition doesn't declare that it's required, then it won't be sent. Try adding the security attribute on the operation, and making sure the reference has the same name as easyapi_basic. For example: http://petstore.swagger.io/v2/swagger.json
Thats it, thanks. I wasn't aware that "easyapi_basic" is a reference to the securityDefinitions.
great