本文介紹了在電子應用程序中使用 Windows auth 連接到 TFS的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
我正在構建一個連接到 TFS 服務器并從中檢索一些數據的電子應用程序.他們使用 Windows 憑據訪問 TFS,我如何通過 chrome 或 node.js 使用 Windows 憑據連接到 TFS?
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 ?
我嘗試了這段代碼,但給了我 401:未授權
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);
});
推薦答案
簡單步驟:
- 創建一個登錄頁面,讓用戶使用用戶名和密碼登錄
- 將用戶名和密碼存儲在變量、cookie 或 本地存儲
- 使用 httpntml 和用戶名、密碼、域發送請求
- 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
這篇關于在電子應用程序中使用 Windows auth 連接到 TFS的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!