zetta-peer-auth

2020-01-16

zetta-peer-auth

Add authorization to Zetta peer requests.

zetta-peer-auth

Add authorization to Zetta peer requests.

Note: This currently only supports the OAuth Client Credentials grant type.

Install

npm install zetta-peer-auth

Usage

var zetta = require('zetta');
var auth = require('zetta-peer-auth');

var options = {
  headers: {
    'Authorization': new Buffer('user:password').toString('base64'),
    'Content-Type': 'application/x-www-form-urlencoded'
  },
  url: 'https://<authorization_server>',
  method: 'POST',
  body: 'grant_type=client_credentials'
}; // request to receive an access token

zetta()
  .use(auth(options))
  .link('http://<resource_server>')
  .listen(3001)

License

MIT

以上是 zetta-peer-auth 的使用教程帮助文档。


上一篇:zetta-peer-redirect
下一篇:voltron
相关教程
关注微信

扫码加入 JavaScript 社区

相关文章

首次访问,需要验证
微信扫码,关注即可
(仅需验证一次)

欢迎加入 JavaScript 社区

号内回复关键字:

回到顶部