我只是注意到有可能很容易地验证服务器端或客户端: https://docs.feathersjs.com/authentication/readme.html
但这些说明依赖于javascript服务器/客户端。 一般来说,如何通过简单的cURL请求对服务器端(微服务)进行身份验证?没有电子邮件,它不是一个真正的用户(服务器到服务器),我们假设我有密钥。
TL; DR 如何将此转换为服务器身份验证的简单cURL请求:
app.configure(authentication({
token: {
secret: 'my-secret'
}
}));
答案 0 :(得分:0)
这取决于feathers-authentication
模块版本。在v0.7.x中:
curl 'http://localhost:3030/auth/local/' -H 'Content-Type: application/json' --data-binary '{ "email": "user@example.com", "password": "secret" }'
在1.x中:
curl 'http://localhost:3030/authentication' -H 'Content-Type: application/json' --data-binary '{ "strategy": "local", "email": "user@example.com", "password": "secret" }'
两者都将为经过身份验证的用户返回一个令牌。