Authorization failure while issuing identity hyper

2019-07-10 00:42发布

问题:

I read the answer suggesting to check the docker.yaml for ca.

The file path is below where I confirm that the username is admin and password is adminpw. Unfortunately I still get authorizatin failure error.

command I use to issue identity

composer identity issue -n 'trade-network' -p hlfv1 -i admin -s adminpw -u trader1 -a "org.acme.trading.Trader#TRADER1"

Error: fabric-ca request register failed with errors [[{"code":400,"message":"Authorization failure"}]] Command failed.

/home/composer/fabric-tools/fabric-scripts/hlfv1/composer/docker-compose.yml line from docker.yaml

command: sh -c 'fabric-ca-server start --ca.certfile /etc/hyperledger/fabric-ca-server-config/org1.example.com-cert.pem --ca.keyfile /etc/hyperledger/fabric-ca-server-config/a22daf356b2aab5792ea53e35f66fccef1d7f1aa2b3a2b92dbfbf96a448ea26a_sk -b admin:adminpw -d'

回答1:

Remove the old admin credentails under ($HOME/.composer-credential), and go back to the existing business network and run either bash for adding identity or through composer-rest-server -p xxxx -n xxxx -i admin -s adminspw to call the endpoint for issuing new identity



回答2:

I faced similar error where I was able to add participants using playground however while issuing identity I face this error of Authorisation.

Workaround:

Delete the admin card :

composer card delete --card admin@your-network-name

Import the card :

composer card import -f admin@your-network-name

again install and start the network using below command.

install :

composer network install -a your-network-name@0.0.1.bna -c PeerAdmin@hlfv1

start :

composer network start -c PeerAdmin@hlfv1 -V 0.0.1 -n your-network-name -A admin -S adminpw

then Import the card and try issuing identity you will not see the error.



回答3:

this problem cause can be your username & pwd for CA container

double check your docker container config, find someplace that looks like

/etc/hyperledger/fabric-ca-server-config/CA1_PRIVATE_KEY -b admin:adminpw -d'

make sure that your configured username&pwd same with username&pwd in your command