我想用护照本地验证用户登录到像其他护照策略(如作曲家休息服务器passport-github,passport-google).
所以首先我尝试设置这样的COMPOSER_PROVIDER变量
"local": {
"provider": "local",
"module": "passport-local",
"usernameField": "username",
"passwordField": "password",
"authPath": "/auth/local",
"successRedirect": "/",
"failureRedirect": "/"}
Run Code Online (Sandbox Code Playgroud)
然后我在docker中运行服务器(使用mongo作为持久化数据源)并在数据库集合中添加一些用户
问题是我需要使用此护照的下一步是什么.因为我运行此命令仍然得到响应 401 Unauthorized
curl -H"Content-Type:application/json"-X POST -d'{"username":"{USER_NAME}","password":"{USER_PASSWORD}"}' http:// localhost:3000/auth /本地
使用这本护照还不够吗?我是否需要启动另一项服务来本地验证此登录(例如GitHub oAuth应用程序)?