How to enable authentication in hyperledger Angular application

0 votes

I have deployed hyperledger composer blockchain to multiple organizations by following this tutorial which is successful.

I have generated angular2 app by using command yo hyperledger-composer:angular by selecting options use existing network and generate new rest api.

When I start application it is successful and I can browse assets and participants from hyperledgercomposer using URL http://localhost:4200

Now I want to enable rest authentication for which I have installed passport-github and configured export option by following this tutorial and edited package.json file of angular2 app as below so that authentication is enabled at start

 "app": "composer-rest-server --card admin@some-network -n never -p 3000 -m true"

I have added -m true option so that authentication is enabled by default when I start angular2 app using npm start command.

When I start application I get below error. How to resolve this?

[0] ** NG Live Development Server is running on http://localhost:4200 **
[0]  10% building modules 4/4 modules 0 activeDiscovered types from business network definition
[1] Generating schemas for all types in business network definition ...
[1] Generated schemas for all types in business network definition
[1] Adding schemas for all types to Loopback ...
[1] Added schemas for all types to Loopback
[1] { Error: Cannot find module 'passport-github'
[1]     at Function.Module._resolveFilename (module.js:536:15)
[1]     at Function.Module._load (module.js:466:25)
[1]     at Module.require (module.js:579:17)
[1]     at require (internal/module.js:11:18)
[1]     at PassportConfigurator.configureProvider (/home/user/tmt/TMT-Innovation-AngApp/node_modules/loopback-component-passport/lib/passport-configurator.js:158:22)
[1]     at Promise.then (/home/user/tmt/TMT-Innovation-AngApp/node_modules/composer-rest-server/server/server.js:133:38)
[1]     at <anonymous>
[1]     at process._tickCallback (internal/process/next_tick.js:188:7) code: 'MODULE_NOT_FOUND' }
[1] npm ERR! code ELIFECYCLE
[1] npm ERR! errno 1
[1] npm ERR! TMT-Innovation-AngApp@0.0.1 app: `composer-rest-server --card admin@some-network -n never -p 3000 -m true`
[1] npm ERR! Exit status 1
[1] npm ERR! 
Jun 16, 2018 in Blockchain by aryya
• 7,460 points
1,426 views

1 answer to this question.

0 votes

Try npm install -g passport-github

answered Jun 16, 2018 by charlie_brown
• 7,720 points

Related Questions In Blockchain

0 votes
0 answers
+15 votes
5 answers
0 votes
1 answer

How do I use hyperledger fabric blockchain to build my own application?

To use fabric I would recommend you ...READ MORE

answered May 17, 2018 in Blockchain by Johnathon
• 9,090 points
1,075 views
0 votes
1 answer

Hyperledger Sawtooth vs Quorum in concurrency and speed Ask

Summary: Both should provide similar reliability of ...READ MORE

answered Sep 26, 2018 in IoT (Internet of Things) by Upasana
• 8,620 points
1,451 views
0 votes
1 answer

Invalid Batch or signature in Savtooth

This will solve your problem import org.apache.commons.codec.binary.Hex; Transaction txn ...READ MORE

answered Aug 1, 2018 in Blockchain by digger
• 26,740 points
1,004 views
+1 vote
1 answer
0 votes
1 answer

How to store picture(s) in a hyperledger blockchain channel

You can hold images as encrypted characters ...READ MORE

answered Jun 16, 2018 in Blockchain by charlie_brown
• 7,720 points
1,348 views
+1 vote
2 answers
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP