How can I specifiy what access I need from my user's Facebook accounts when using OmniAuth?

前端 未结 2 1822
滥情空心
滥情空心 2021-02-10 10:48

When you use OmniAuth to login to a web app through Facebook, these are the permissions the webapp has:

Access my basic information Includes name, profile pictu         


        
2条回答
  •  误落风尘
    2021-02-10 10:53

    You can check on option using the :scope attribute:

    use OmniAuth::Strategies::Facebook, 'app_id', 'app_secret', {:scope => 'email,offline_access, your,scope,you,want'}
    

    Check the Facebook permissions documentation what scope you really want and define it separate by a commant on :scope option.

    If you use an initializer to define your OamniOauth, it's like that:

    Rails.application.config.middleware.use OmniAuth::Builder do
      provider :facebook, 'APP_ID', 'APP_SECRET', {:scope => 'email,offline_access, your,scope,you,want'}
    end
    

提交回复
热议问题