使用电子应用程序中的Windows身份验证连接到TFS [英] connecting to TFS using windows auth in electron app

查看:63
本文介绍了使用电子应用程序中的Windows身份验证连接到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);
                });


推荐答案

简单步骤:


  1. 创建一个登录页面,让用户使用用户名和密码登录

  2. 将用户名和密码存储在变量,cookie或本地存储空间

  3. 使用 httpntml ,用户名,密码,域名

  1. Create a login page to let user login with username and password
  2. Store username and password in a variable, cookie or local storage
  3. Send the request by using httpntml with username, password, domain

这篇关于使用电子应用程序中的Windows身份验证连接到TFS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆