从Java客户端验证区块链?

时间:2018-03-30 18:29:29

标签: rest swagger hyperledger-fabric hyperledger-composer

我使用Hyperledger Composer构建了区块链网络,启动了Composer Rest Server并从Open API规范生成了Java客户端代码以使用REST Api。我查看了文档以启用身份验证和多用户模式。我的Web应用程序中已经有身份验证。在我们登录我的网络应用程序后,我将如何授予用户与区块链交互的权限? 感谢。

1 个答案:

答案 0 :(得分:0)

您能否告诉我们您使用哪种策略进行网络应用程序身份验证?

最近更新的文档@ https://hyperledger.github.io/composer/latest/integrating/enabling-rest-authentication

The REST server uses the open source Passport authentication middleware. 
Administrators of the REST server must select Passport strategies to 
authenticate clients. Multiple Passport strategies can be selected, allowing 
clients of the REST server to select a preferred authentication mechanism. 
Passport includes a wide range of strategies (300+ at the time of writing), 
including a mix of social media (Google, Facebook, Twitter) and enterprise 
(SAML, LDAP) strategies.

您需要配置适当的passport-strategy以生成将由REST API SERVER使用的access_token