connecting to TFS using windows auth in electron app

北战南征 提交于 2019-12-02 21:17:41

问题


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);
                });

回答1:


Simple steps:

  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


来源:https://stackoverflow.com/questions/43309163/connecting-to-tfs-using-windows-auth-in-electron-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!