@tng/soa-node-auth

SOA-ORG for Node ================

Stats

stars 🌟issues ⚠️updated 🛠created 🐣size 🏋️‍♀️
@tng/soa-node-auth
Minified + gzip package size for @tng/soa-node-auth in KB

Readme

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(): 更新应用授权范围

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.