2

Can I use passport-localstrategy, knowing that i'm using angular front-end generated by the composer-rest-server tool?

Because in the passportjs documentation for passport-local they write that it can be used just in node.js applications.

irkoch
  • 75
  • 9
  • can you be more specific? – Moshe Slavin Jan 02 '19 at 10:56
  • @MosheSlavin im using angular for interacting with my business network (hyperledger runtime) using composer rest server as middleware, i want to implement the Local Passport Strategy for the multiple user authentication and i do not have any idea to do this for localpassport – irkoch Jan 02 '19 at 11:09

1 Answers1

1

The yo generated angular application is only meant to give you a starting point. It is not designed to work with any authentication or multi-user enablement of the composer-rest-server. You will have to modify the generated application to suite your needs and also implement whatever is necessary to support whatever passport strategy you have chosen for the composer-rest-server to use. Please note that the local passport strategy will not work out of the box. There is more information about this available here Composer-rest-server with passport-local strategy

david_k
  • 5,843
  • 2
  • 9
  • 16
  • Hi @david_k please how can modify the generated app to support whatever passport strategy, sorry for this noob question i'm still beginner in hyperledger. – irkoch Jan 02 '19 at 13:30
  • It depends on your passport strategy to how your front end application will request whatever authorisation information is required, so for example if you choose a passport strategy that requires a userid/password then you will need to create something using angular (which isn't specific to hyperledger composer) yourself, so you need to understand web development and specifically angular programming to help you do that. Then you need to interact with the composer rest server to pass whatever information is required on whatever url you configure the strategy to expect – david_k Jan 02 '19 at 17:11
  • An example using github passport strategy that manages this can be found here https://medium.com/@CazChurchUk/developing-multi-user-application-using-the-hyperledger-composer-rest-server-b3b88e857ccc but this doesn't provide a login panel. You might be able to find other examples by search the web or stackoverflow – david_k Jan 02 '19 at 17:14