Hyperledger-Composer:使用REST-API颁发身份会导致错误消息“ fabric-ca请求注册失败”

时间:2018-08-16 17:39:35

标签: javascript angular typescript hyperledger-composer hyperledger-fabric-ca

我已经创建了一个具有Angular前端和多用户身份验证的hyperledger-composer应用程序。

管理员可以创建新的参与者并为该参与者颁发身份。

将参与者添加到网络可以正常工作。但是第二步-为该新参与者颁发身份会导致以下错误消息:

 "message": "fabric-ca request register failed with errors [[{\"code\":20,\"message\":\"Authorization failure\"}]]",

...请参见以下屏幕截图:

enter image description here

enter image description here

导致此错误消息的方法如下:

 createBusinessNetworkCardFile(idOfNewParticipant: string): Promise<any> {

    let identity = {
        participant: org.comp.app# + idOfNewParticipant,
        userID: idOfNewParticipant,
        options: {}
    };

    return this.httpClient.post('/api/system/identities/issue', identity, {responseType: 'blob'}).toPromise()
    .then(cardData => {

        this.businessNetworkCardFile = new File([cardData], 'businessNetworkCard.card', {type: 'application/octet-stream', lastModified: Date.now()});
        //some more code

    });

  }

0 个答案:

没有答案