connecting to TFS using windows auth in electron app(在电子应用程序中使用 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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:在电子应用程序中使用 Windows auth 连接到 TFS


基础教程推荐
- npm start 错误与 create-react-app 2022-01-01
- 检查 HTML5 拖放文件类型 2022-01-01
- 如何添加到目前为止的天数? 2022-01-01
- Bokeh Div文本对齐 2022-01-01
- Fabric JS绘制具有活动形状的多边形 2022-01-01
- 在 contenteditable 中精确拖放 2022-01-01
- fetch 是否支持原生多文件上传? 2022-01-01
- Bootstrap 模态出现在背景下 2022-01-01
- 原生拖动事件后如何获取 mouseup 事件? 2022-01-01
- 即使用户允许,Gmail 也会隐藏外部电子邮件图片 2022-01-01