0

I run the sample from Hyperledger Fabric for registering Users from a Fabric CA using NodeJS SDK. The user is successfully registered, however I notice that the Roles, the Affiliation and the enrollmentSecret are all empty eventhough when it is registered, the fabric CA can notice the values of the roles, affiliation and the secret. After that, when looking at the file hfc_key_store folder for the user, it doesn't record the Role, secret and Affiliation. Once the user is registerred, how can I retrieve all the information, especially the secret?

Thanks a lot.

2ps
  • 15,099
  • 2
  • 27
  • 47

1 Answers1

0

The register method returns the secret value:

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

In this case, the variable will be equal to "pass123

Phillip
  • 6,033
  • 3
  • 24
  • 34
Mtng
  • 61
  • 6