【发布时间】:2015-07-22 16:21:11
【问题描述】:
有很多关于如何保护 REST API 访问的资源,但这不是我想要的。我将使用提供的带有 Basic Authentication 的 REST API(这不能轻易更改:()。
显然我可以选择:
var requestOptions = {
hostname: "rest.api.url.com",
path: "/path/",
auth: "username:password"
};
var req = http.request(requestOptions, function (res) {
// some code here
});
有没有办法在脚本中不提供纯文本密码?
【问题讨论】:
标签: javascript rest restful-authentication