使用誓言或带有hyperledger-fabric-ca的电子邮件/密码进行注册/登录

时间:2019-09-16 13:12:50

标签: hyperledger-fabric hyperledger user-registration hyperledger-fabric-ca

我是Hyperledger Fabric开发的新手,我正在尝试进行用户友好的注册。
例如:
+使用Google帐户的Oauth。
+或使用传统的电子邮件密码注册。

我已经阅读了超级账本结构文档并尝试了其中的一些示例。我所知道的是新的身份创建过程是这样的:
1.使用fabric-ca客户端或SDK从fabric-ca服务器获取管理员身份。
2.使用该管理员身份注册新身份。
3.然后,fabric-ca服务器将发回新的身份ID和密码(所谓的密码)。
4.用户将使用该ID和密码来注册新用户,以及创建交易等。

所以,我的问题是:

  1. 我应该做些什么额外的工作来使注册/登录过程看起来像传统的Oauth或用户/电子邮件注册。
  2. 我应该在哪里存储用户的其他信息,例如电子邮件,密码,生日等
    (我之前读过这个问题:User registration & login in Hyperledger fabric,所以我认为有办法做到这一点,但尚未弄清楚)。

1 个答案:

答案 0 :(得分:0)

您可以使用 ldap 进行身份验证,并使用 mysql 或 postgres 任何这些数据库与fabric-ca 连接。由于您将使用 ldap ,您将能够使用普通电子邮件和密码进行注册,这是根据 hyperledger Fabric 文档推荐的方法。

Fabric CA 服务器可以配置为从 LDAP 服务器读取数据。

特别是,Fabric CA 服务器可能会连接到 LDAP 服务器以执行以下操作:

在注册前验证身份 检索用于授权的身份属性值。 修改 Fabric CA 服务器配置文件的 LDAP 部分,将服务器配置为连接到 LDAP 服务器。

ldap:
   # Enables or disables the LDAP client (default: false)
   enabled: false
   # The URL of the LDAP server
   url: <scheme>://<adminDN>:<adminPassword>@<host>:<port>/<base>
   userfilter: <filter>
   attribute:
      # 'names' is an array of strings that identify the specific attributes
      # which are requested from the LDAP server.
      names: <LDAPAttrs>
      # The 'converters' section is used to convert LDAP attribute values
      # to fabric CA attribute values.
      #
      # For example, the following converts an LDAP 'uid' attribute
      # whose value begins with 'revoker' to a fabric CA attribute
      # named "hf.Revoker" with a value of "true" (because the expression
      # evaluates to true).
      #    converters:
      #       - name: hf.Revoker
      #         value: attr("uid") =~ "revoker*"
      #
      # As another example, assume a user has an LDAP attribute named
      # 'member' which has multiple values of "dn1", "dn2", and "dn3".
      # Further assume the following configuration.
      #    converters:
      #       - name: myAttr
      #         value: map(attr("member"),"groups")
      #    maps:
      #       groups:
      #          - name: dn1
      #            value: client
      #          - name: dn2
      #            value: peer
      # The value of the user's 'myAttr' attribute is then computed to be
      # "client,peer,dn3".  This is because the value of 'attr("member")' is
      # "dn1,dn2,dn3", and the call to 'map' with a 2nd argument of
      # "group" replaces "dn1" with "client" and "dn2" with "peer".
      converters:
        - name: <fcaAttrName>
          value: <fcaExpr>
      maps:
        <mapName>:
            - name: <from>
              value: <to>

有关详细信息,请访问 Fabric-CA docs 此处。

相关问题