i'm building an electron app that connect to a TFS server and retrieve some data from it. They use Windows credential to access TFS , how can i connect to TFS using Windows credential through chrome or node.js ?
i tried this code but give me 401 : unauthorized
$.ajax({
url: 'https://tfs.myserver.com:8090/tfs/IKM.TPC.Projects/MR/_workitems',
type: 'GET',
dataType: 'json',
xhrFields: {
withCredentials: true
}
})
.done(function (data) {
$('#result').text(data);
})
.fail(function (jqXHR, textStatus, errorThrown) {
$('#result').text(textStatus);
});
Simple steps:
- Create a login page to let user login with username and password
- Store username and password in a variable, cookie or local storage
- Send the request by using httpntml with username, password, domain
来源:https://stackoverflow.com/questions/43309163/connecting-to-tfs-using-windows-auth-in-electron-app