在facebook身份验证后使用门卫验证

Ani*_*uja 5 authentication facebook ruby-on-rails ruby-on-rails-3 doorkeeper

用户通过我的移动应用程序通过Facebook验证后,如何实现正常的门卫oauth2流程?

PS我正在使用门卫gem为我的移动应用程序实现oauth2提供程序.我使用资源所有者密码凭证流来通过用户的用户名和密码实现身份验证.

因此,如果用户首先通过移动应用程序通过Facebook进行身份验证,如何通过门户使用facebook访问令牌对用户进行身份验证.因此在这种情况下不存在用户名/密码(哪个门卫抛出错误参数的错误).

实现此流程的正确方法是什么.

 1. User authenticates from facebook through the mobile app.
 2. Facebook access token is passed to the API server.
 3. If the access token is valid, the api server returns the
    doorkeeper access token.
 4. In case the access token is not valid, the api server returns 401 Unauthorized.
Run Code Online (Sandbox Code Playgroud)

实现此流程的正确方法是什么?非常感谢正确方向的一些指导.

Edo*_*Edo 6

对现有门卫授权流程的这种扩展,正好解决了这个问题:https: //github.com/doorkeeper-gem/doorkeeper-grants_assertion

断言流是提供者的access_token之间的交换,用于来自oauth提供者的访问令牌.