【发布时间】:2018-04-08 21:54:43
【问题描述】:
我使用命令部署了 Hyperledger Fabric API:
-> composer-rest-server -c admin@mynetwork -a true -m true
我有这样的本地环境变量:
export COMPOSER_PROVIDERS='{
"github": {
"provider": "github",
"module": "passport-github",
"clientID": "e3e9af5103fde6d4cc54",
"clientSecret": "45ce6aaa9ff142cafd73c0b35509713ab24c627b",
"authPath": "/auth/github",
"callbackURL": "/auth/github/callback",
"successRedirect": "/",
"failureRedirect": "/"
}
}'
我在 github 中有这样的身份验证: 主页网址:
http://localhost:3000/
授权回调网址:
http://localhost:3000/auth/github/callback
我还有一个客户端 Web 应用,它在 Github 中进行身份验证。
问题: 我的 Web 客户端在 github 中完成了身份验证,并将 access_token 保存在 cookie 中。然后我执行帖子以这样的文件上传我的身份证:
http://localhost:3000/api/wallet/import?name=myName&access_token="+$scope.access_token;
问题是执行帖子后,我有这个错误:
statusCode":401,"name":"Error","message":"Authorization Required","code":"AUTHORIZATION_REQUIRED"
我做错了什么?这是环境变量吗?我可以清楚地看到 API 正在运行,否则我不会收到此错误消息,但 API 身份验证显然有问题...
【问题讨论】:
标签: hyperledger-fabric hyperledger hyperledger-composer