[英]loopback logout access_token is required
I want to test loopbacks logout endpoint. 我想测试回送注销端点。 But it returns access_token is required.
但是它返回access_token是必需的。 what is the correct JSON body to feed or the loopback user logout endpoint?
什么是正确的JSON正文或回送用户注销端点?
This code snippet will logout your user. 此代码段将注销您的用户。
User.logout('asd0a9f8dsj9s0s3223mk', function (err) {
console.log(err || 'Logged out');
});
I assume you aren't setting the access token on the Loopback API Explorer. 我假设您没有在Loopback API资源管理器上设置访问令牌。
You will find this access token section on the top right corner of your API Explorer. 您将在API资源管理器的右上角找到此访问令牌部分。
UPDATE 更新
To call from a client. 从客户打电话。 Add the Access token as a query parameter or header.
将访问令牌添加为查询参数或标头。
ACCESS_TOKEN=6Nb2ti5QEXIoDBS5FQGWIz4poRFiBCMMYJbYXSGHWuulOuy0GTEuGx2VCEVvbpBK
# Authorization Header
curl -X GET -H "Authorization: $ACCESS_TOKEN" \
http://localhost:3000/api/widgets
# Query Parameter
curl -X GET http://localhost:3000/api/widgets?access_token=$ACCESS_TOKEN
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.