Asad Hayat
Asad Hayat

Reputation: 400

Whatever the username, Hyperledger Fabric Sample App, Balance Transfer, log in successfully

I am playing around with hyperledger fabric sample apps. In "Balance transfer" app, they have provided sample requests to login user, create channel and more..... But whatever the username i provide, it logged it in successfully. Request:

curl -s -X POST \
  http://localhost:4000/users \
  -H "content-type: application/x-www-form-urlencoded" \
  -d 'username=Jim&orgName=org1'

Response

{
    "success": true,
    "secret": "GSHPwdfBQyzB",
    "message": "Jim enrolled Successfully",
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1MTI0MjkxNzYsInVzZXJuYW1lIjoiSmltIiwib3JnTmFtZSI6Im9yZzIiLCJpYXQiOjE1MTIzOTMxNzZ9.AAH5A9V08QfMvPmsDpoHVkYsFNbQX-nRMU025NziZRc"
}

No matter what username i provide it log it in successfully. Can anyone explain, what is actually going on.

Upvotes: 0

Views: 471

Answers (1)

Nabil
Nabil

Reputation: 186

The command

curl -s -X POST \ http://localhost:4000/users \ -H "content-type: application/x-www-form-urlencoded" \ -d 'username=Jim&orgName=org1'

registers and enrolls a user. You are sending the POST request as an admin with registration privileges.

Upvotes: 1

Related Questions