I have created a hyperledger-composer application with an Angular frontend and multi-user authentication.
The admin can create a new participant and issue an identity for this participant.
Adding the participant to the network works fine. But the second step - issuing an identity for this new participant results in the following error message:
"message": "fabric-ca request register failed with errors [[{\"code\":20,\"message\":\"Authorization failure\"}]]",
... see the following screenshots:
and
The method causing this error message is the following:
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
});
}
来源:https://stackoverflow.com/questions/51882586/hyperledger-composer-issuing-identity-using-rest-api-results-in-error-message

