Search code examples
hyperledger-fabrichyperledger-fabric-ca

Can we provide customise password instead of enrollment secret in hyperledger fabric while user registration


I trying to implementing the user registration with fabric-ca client as mentioned in https://github.com/hyperledger/fabric-samples/tree/release-1.4/fabcar/javascript

In that we have the registerUser.js file in which function used for register the user, enroll the user. while using below function fabric ca generating secret which is random character, however I need it as per user password like password@123.

const secret = await ca.register({ affiliation: 'org1.department1', enrollmentID: 'user1', role: 'client' }, adminIdentity);

Can we implement this requirement?

Thanks in advance


Solution

  • Yes, of course. Just specify the enrollmentSecret you want.

    https://hyperledger.github.io/fabric-sdk-node/release-1.4/global.html#RegisterRequest