0
我试图从nodejs
使用https request
(尝试使用GET
和POST
方法)撤销销售团队令牌。撤销销售团队令牌nodejs
这是我GET method
var token = user.token;
var uri = token.instanceUrl+'/services/oauth2/revoke?token='+token.accessToken;
console.log("data: "+postData+", options: "+JSON.stringify(postOptions)+ ", \r\n" + uri);
https.get(uri, function(response){
var buffer = '';
console.log(response.statusCode);
response.on('data', function (chunk) {
buffer += chunk;
});
response.on('end', function(){
console.log(buffer);
});
});
代码,但我不断获取此
error=unsupported_token_type&error_description=this%20token%20type%20is%20not%20supported, code: 400
我也试图在浏览器的地址并获得400 Bad Request
状态。
所有必需的选项已经根据销售人员的在线文档设置https://help.salesforce.com/apex/HTViewHelpDoc?id=remoteaccess_revoke_token.htm&language=en
我缺少这使得它成为错误的请求?
我会试试这种方式。我正在使用实例URL,因为使用login.salesforce.com返回302状态码 – mynawaz
相同的结果,'statusCode:400,body:'error = unsupported_token_type&error_description = this%20token%20type%20is%20not%20supported'' – mynawaz
如果您是确定您传递的是'access_token',同时请注意,撤销方法仅适用于OAuth2,因此您必须确保在登录用户时使用的是OAuth2流。查看[这里](https://grant-oauth.herokuapp.com/#/linkedin2) - [Grant](https://github.com/simov/grant)同时支持LinkedIn的OAuth1.0和OAuth2流。 – simo