3

i'm trying to implement the Local Passport Strategy for Hyperledger Composer Rest Server.
Instead of using a third part service to authenticate the users (in the official example is used GitHub Oauth https://hyperledger.github.io/composer/integrating/enabling-rest-authentication) i would retrieve the data directly from a local db.
Does anyone any advice about the architecture and configuration to adopt in order to achive this?

Thanks in advance.
Best regards.

Leonardo Carraro
  • 1,532
  • 1
  • 11
  • 24

1 Answers1

3

Composer supports the passport strategies at http://www.passportjs.org/packages/

See this Stack overflow -> How to use passport-local to authenticate in composer rest server but its COMPOSER_PROVIDERS not COMPOSER_PROVIDER fyi.

Not tried this but something like this for COMPOSER_PROVIDERS:

"local": { "provider": "local", "module": "passport-local", "usernameField": "username", "passwordField": "password", "authPath": "/auth/local", "callbackURL":"/auth/local/callback", "successRedirect": "/", "failureRedirect": "/", "setAccessToken": true, "callbackHTTPMethod": "post" },

hope this helps.

Paul O'Mahony
  • 6,740
  • 1
  • 10
  • 15