Composer-rest-server with passport-local strategy

2019-02-28 05:55发布

I am not able to find a working solution to authenticate using local strategy in composer-rest-server. In fact only one working solution is using github. I tried setting up the COMPOSER_PROVIDERS as

export 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" 
   }
}'

but no luck. I am not even getting a login form for this. for localhost:3000/auth/local , I am getting 404. Looks like no one has tried local authentication strategy till now. I am new to nodejs programming. Any help is highly appreciated.

2条回答
Fickle 薄情
2楼-- · 2019-02-28 06:32

Solved this by changing the callback function to default one in passport-configurator.js

查看更多
登录 后发表回答