【问题标题】:How to use omniauth-google-oauth2 gem with incremental authorization in Rails?如何在 Rails 中使用带有增量授权的 omniauth-google-oauth2 gem?
【发布时间】:2014-02-27 10:05:02
【问题描述】:

我正在使用omniauth-google-oauth2 gem。 我的 oauth2 设置与此处的设置非常相似:https://gist.github.com/sevos/821291,这意味着我将范围保存在 config/authentication_services.yml 文件中。

我想从初始请求中排除一个范围,并仅在需要时才请求该范围?

【问题讨论】:

    标签: ruby-on-rails oauth-2.0 omniauth


    【解决方案1】:

    您需要的可能与omniuath 的动态范围设置有关。很少有可能让您更接近的阅读,它们是关于 facebook oauth 的,但一般概念非常相似 - 您需要使用omniauths setup hook。

    http://www.mikepackdev.com/blog_posts/2-Dynamically-Requesting-Facebook-Permissions-with-OmniAuth

    How can I specify the Facebook permissions (aka scope) OmniAuth asks for DYNAMICALLY?

    http://www.mikepackdev.com/blog_posts/2-Dynamically-Requesting-Facebook-Permissions-with-OmniAuth\

    【讨论】:

      猜你喜欢
      • 2019-11-02
      • 1970-01-01
      • 2017-09-27
      • 2012-07-11
      • 2012-09-12
      • 1970-01-01
      • 2019-03-26
      • 1970-01-01
      • 2018-02-07
      相关资源
      最近更新 更多