在电子应用程序中使用 Windows auth 连接到 TFS
- 作者: 五毛39649747
- 来源: 51数据库
- 2022-11-03
问题描述
我正在构建一个连接到 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
推荐阅读
热点文章
检查拆分键盘
0
带有“上一个"的工具栏和“下一个"用于键盘输入AccessoryView
0
Activity 启动时显示软键盘
0
UIWebView 键盘 - 摆脱“上一个/下一个/完成"酒吧
0
在 iOS7 中边缘滑动时,使键盘与 UIView 同步动画
0
我的 iOS 应用程序中的键盘在 iPhone 6 上太高了.如何在 XCode 中调整键盘的分辨率?
0
android:inputType="textEmailAddress";- '@' 键和 '.com' 键?
0
禁用 iPhone 中键盘的方向
0
Android 2.3 模拟器上的印地语键盘问题
0
keyDown 没有被调用
0
