【发布时间】:2016-06-18 04:44:18
【问题描述】:
我正在研究 Node.js,在其中我使用 superagent 来调用 oauth 令牌生成请求,并且我正在手动解析一个响应,从中提取 access_token、refresh_token、token_type、expires_in 等.
以下是通过 superagent 调用生成 oauth 令牌的 sn-p
superagent
.post('https://myapi.com/oauth_token.do')
.proxy(proxy)
.type('form')
.send({grant_type: 'password' })
.send({client_id: 'client-id-value' })
.send({client_secret: 'client-secreat-value' })
.send({username: 'user' })
.send({password: 'pass' })
.set('Accept', 'application/json')
.end(function(err, res){
if (err || !res.ok) {
// error handling..
} else {
// response parsing..
});
我正在寻找负责生成 oauth 令牌的 node.js 模块。是否有相同的节点 js 模块?
如果可能的话,请您也分享一下示例。
谢谢。
【问题讨论】: