login to jenkins using ajax/javascript
This worked for me, thanks a lot, just to expand, it worked because As per RFC 1945, the Authorization header value should contain the username:password as encoded (base64) string, which would result in something like the following header:
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
example:
beforeSend: function (xhr) {xhr.setRequestHeader("Authorization", "Basic " + btoa("username:token"));}
beforeSend: function (xhr) { xhr.withCredentials = true; data: $("[name='parameters']").serialize() xhr.setRequestHeader("Authorization", "Basic " + btoa("test:d8db6ae61f03219c52042638488e9744"));},
works for me