0

I have created a Hyperledger Composer Business network and have started the Rest server in multi user mode with Github based authentication enabled.

My COMPOSER_PROVIDERS variable looked like this :
COMPOSER_PROVIDERS='{
    "github": {
        "provider": "github",
        "module": "passport-github",
        "clientID": "my-client-id",
        "clientSecret": "my-client-secret",
        "authPath": "/auth/github",
        "callbackURL": "/auth/github/callback",
        "successRedirect": "/",
        "failureRedirect": "/"
    }
}'

Now I have created multiple business network cards but I can use only one of this card at a time i.e. One which has been set as default using the "POST /wallet/{name}/setDefault" API. I have tried logging in with different browsers and different machines. As per Question "Create Card through composer-rest-server" it requires 2 different clients if i want to run 2 different users with separate Network card, But I am not sure how to configure 2 Users in my composer providers. Also configuring the client id and secret statically defeats the purpose of adding users on the fly. Suppose 5 different Users want to connect with Rest server by doing signup , Is there some way I can add client id and client secret configuration in Composer_providers at run time, instead of adding that in Environment variable.

1 Answers1

1

The GitHub Client ID and Secret are just used as a mechanism to register your REST server with Github to lookup and enable Authentication. You only need one Client ID and Secret and you should not need to change them.

The way this is designed to work is that each user logs in to the REST server using their Github own unique ID, and they then have a unique Wallet into which they import their card.

I test the REST server using 2 Github IDs in 2 different browsers, with Private / Incognito windows.

(Github and Google are used as examples of Authentication mechanisms in the Composer Docs, but many production examples will use an LDAP or Kerberos as the authentication strategy.)

R Thatcher
  • 5,550
  • 1
  • 7
  • 15
  • Can you please share some link on how i can user Kerberos or some other LDAP startegy for authetication. On internet most of the links are for github or google based authetication only. – proudengineer Jun 19 '18 at 06:04