@tng/soa-node-auth

1.1.1 • Public • Published

SOA-ORG for Node

安装

yarn add @tng/soa-node-auth

request 模块

使用

const SOAAuth = require('@tng/soa-node-auth')
const TWSAuth = require('tws-auth')
const Teambition = require('teambition')

// use tws-auth
let twsAuth = new TWSAuth({ ... })
let soaorg = new SOAOrg({ twsAuth: twsAuth })

// use teambition
let teambition = new Teambition({ ... })
let soaauth = new SOAAuth({ teambition: teambition })

let auth = yield soaauth.apps().authorize().getAccessToken()
console.log(auth)

// set timeout
let auth = yield soaorg.apps().authorize().getAccessToken({
  timeout: 5000
})
console.log(auth)

测试

npm test

接口

auth

  • apps()

    • .authorize().getAccessToken(): 返回Auth认证授权后的AccessToken
    • .verify().token().valid(): 验证应用的 access_token
  • auths()

    • .active(): 激活应用授权
    • .statistics().list(): 返回一个应用被用户使用的统计信息
    • .search(): 返回一个应用被用户使用的具体信息
    • .list(): 根据resouceID和resourceType返回相关授权
    • .remove(): 删除用户授权
    • .expired().update(): 更新应用授权过期时间
    • .name().update(): 更新应用授权Name
    • .policies().update(): 更新应用授权范围

Readme

Keywords

none

Package Sidebar

Install

npm i @tng/soa-node-auth

Weekly Downloads

2

Version

1.1.1

License

ISC

Unpacked Size

35.7 kB

Total Files

7

Last publish

Collaborators

  • aerohui
  • isayme
  • orangemi