【发布时间】:2018-12-01 12:12:20
【问题描述】:
我正在使用这个库:https://github.com/manjeshpv/node-oauth2-server-implementation
根据我对 Oauth2 的理解:
1)Generate a clientid and clientSecret
2)User use clientId and clientSecret to get a bearerToken
3)Authorisation server returns accessToken to users if valid clientId and clientSecret combination
4)User then use the accessToken to run http post/get api calls (within their scope)
在 GITHUB 中给出的 POSTMAN 示例中,我们有
我注意到 Password Grant、Refresh Token 、Client Credential Grant 和 Authorization Grant 指向同一个 POST 请求,但正文不同。
和 Authorize 示例 Web 服务,我假设用户必须单击才能让授权服务器返回访问代码,以便用户调用范围特定的 API url,但不知何故也需要访问代码,我我很困惑。
如果我使用客户端凭据授予(我假设是使用我的 clientId 和 clientSecret 返回一个 AccessToken),那么授权 Web 服务的意义何在?
这个库和网络服务示例的正确流程是什么?
非常感谢您的帮助,谢谢!
【问题讨论】:
标签: node.js express oauth oauth-2.0