我正在尝试为 Hyperledger Composer Rest Server 实现 Local Passport Strategy。
而不是使用第三方服务来验证用户(在官方示例中使用 GitHub Oauth https://hyperledger.github.io/composer/integrating/enabling-rest-authentication )
我会直接从本地数据库中检索数据。
有没有人对为实现这一目标而采用的架构和配置有任何建议?
提前致谢。
最好的问候。
最佳答案
Composer 在 http://www.passportjs.org/packages/ 支持 Passport 策略
查看此 Stack overflow -> How to use passport-local to authenticate in composer rest server但它的 COMPOSER_PROVIDERS
不是 COMPOSER_PROVIDER
fyi。
没有试过这个但是对于 COMPOSER_PROVIDERS 是这样的:
“本地的”: {
“提供者”:“本地”,
“模块”:“本地 Passport ”,
"用户名字段": "用户名",
"密码字段": "密码",
"authPath": "/auth/local",
"callbackURL":"/auth/local/callback",
“成功重定向”:“/”,
“失败重定向”:“/”,
“setAccessToken”:真实的,
“callbackHTTPMethod”:“发布”
},
希望这对您有所帮助。
关于passport.js - Hyperledger Composer - Rest Server Local Passport 策略,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49409675/