TypeScript vso-node-api/WebApi getNtlmHandler示例

说明

typescript vso-node-api/webapi getntlmhandler示例是从最受好评的开源项目中提取的实现代码,你可以参考下面示例的使用方式。

编程语言: TypeScript

命名空间/包名称: vso-node-api/WebApi

示例#1
文件: credentialinfo.ts 项目: chrisdias/vsts-vscode

 constructor(username: string, password?: string, domain?: string, workstation?: string) {
     if (username !== undefined && password !== undefined) {
         // NTLM (we don't support Basic auth)
         this._credentialHandler = getNtlmHandler(username, password, domain, workstation);
     } else {
         // Personal Access Token (use username since it is first argument to constructor)
         this._credentialHandler = getBasicHandler(Constants.OAuth, username);
     }
 }

示例#2
文件: extensionrequesthandler.ts 项目: Microsoft/vsts-vscode

 constructor(username: string, password?: string, domain?: string, workstation?: string) {
     if (username !== undefined && password !== undefined) {
         // NTLM (we don't support Basic auth)
         this._username = username;
         this._password = password;
         this._domain = domain;
         this._workstation = workstation;
         this._credentialHandler = getNtlmHandler(this._username, this._password, this._domain, this._workstation);
     } else {
         // Personal Access Token
         this._username = Constants.OAuth;
         this._password = username; //use username since it is first argument to constructor
         this._credentialHandler = getBasicHandler(this._username, this._password);
     }
 }

展开阅读全文