dingtalk_suite
Advanced tools
Comparing version 0.1.7 to 1.1.7
31
index.js
@@ -14,4 +14,2 @@ var agent = require('superagent'); | ||
this.suite_secret = conf.secret; | ||
this.SSOSecret = conf.SSOSecret; | ||
this.corpid = conf.corpid; | ||
this.ticket_expires_in = TICKET_EXPIRES_IN; | ||
@@ -32,31 +30,2 @@ this.token_expires_in = conf.token_expires_in || TOKEN_EXPIRES_IN; | ||
Api.prototype.getSSOToken = function(callback) { | ||
var self = this; | ||
console.log('corpid', self.corpid); | ||
console.log('corpsecret', self.SSOSecret); | ||
agent.get(SSO_BASE_URL + '/sso/gettoken') | ||
.query({ | ||
corpid: self.corpid, | ||
corpsecret: self.SSOSecret | ||
}) | ||
.end(util.wrapper(callback)); | ||
}; | ||
//登录 | ||
Api.prototype.getSSOUserInfoByCode = function(code, callback) { | ||
var self = this; | ||
self.getSSOToken(function(err, token) { | ||
if (err) { | ||
return callback(err); | ||
}; | ||
console.log('SSO token', token); | ||
agent.get(SSO_BASE_URL + '/sso/getuserinfo') | ||
.query({ | ||
code: code, | ||
access_token: token.access_token | ||
}) | ||
.end(util.wrapper(callback)); | ||
}); | ||
}; | ||
Api.prototype.getLatestTicket = function(callback) { | ||
@@ -63,0 +32,0 @@ var now = Date.now(); |
{ | ||
"name": "dingtalk_suite", | ||
"version": "0.1.7", | ||
"version": "1.1.7", | ||
"main": "index", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -16,4 +16,2 @@ # dingtalk suite | ||
secret: 'C1oXyeJUgH_QXEHYJS4-Um-zxfxxxxxxxxxxxxxxxxxx-6np3fXskv5dGs', | ||
corpid: 'dingxxxxxxxxxxxxxxx', | ||
SSOSecret:'C1oXyeJUgH_QXEHYJS4-Um-zxfxxxxxxxxxxxxxxxxxx-6np3fXskv5dGs', | ||
getTicket: function(callback){ | ||
@@ -74,3 +72,3 @@ //从数据库中取出Tikcet,返回的data样式为:{value: 'xxxxxxx', expires:1452735301543} | ||
``` | ||
### ISV为授权方的企业单独设置IP白名单 | ||
### 为授权方的企业单独设置IP白名单 | ||
```js | ||
@@ -80,12 +78,6 @@ //ip_whitelist为数组格式:["1.2.3.4","5.6.*.*"] | ||
``` | ||
### 免登CODE换取微应用管理员信息 | ||
```js | ||
//ip_whitelist为数组格式:["1.2.3.4","5.6.*.*"] | ||
api.getSSOUserInfoByCode(code, callback) | ||
``` | ||
##钉钉文档 | ||
http://ddtalk.github.io/dingTalkDoc/?spm=a3140.7785475.0.0.p5bAUd#1-isv接口调用整体流程 | ||
##更多钉钉相关 | ||
ISV套件回调server: [dingtalk_suite_callback](https://github.com/hezedu/dingtalk_suite_callback)<br> | ||
企业号API: [dingtalk_enterprise](https://github.com/hezedu/dingtalk_enterprise)<br> | ||
ISV和企业号免登API: [dingtalk_sso](https://github.com/hezedu/dingtalk_sso) |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1
10096
167
80