0

I need an ability for admin to change user attributes. My first attempt was try to reenroll user. It does not work, see below. If I revoke yser certificate, and trying to make new one , system says me that user already exists.

I saw reenroll function in ca client.

I made reenroll function work and it working only for user who holds certificate. Admin cannot reenroll users. Is there other legal way to change user attributes?

I use nodejs 8 and 1.3.0 sdk for nodejs.

Raiv
  • 5,731
  • 1
  • 33
  • 51

1 Answers1

1

You should take a look at the Update function on the IdentityService. This should allow you to update attributes for an already existing user. You will need to do something like this:

const req = { type: 'testType', affiliation: 'testAffiliation', maxEnrollments: 42, attrs: 'testAtts', enrollmentSecret: 'shhh!', caname: 'caName' }; await identity.update('bob', req, registrar);

I would take a look at this Node test case that shows how to update an identity: https://github.com/hyperledger/fabric-sdk-node/blob/v1.3.0/fabric-ca-client/test/IdentityService.js#L421

Saad Karim
  • 229
  • 2
  • 10