Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8603509
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T02:20:29+00:00 2026-06-12T02:20:29+00:00

I’ve followed Railscast 360 to setup Omniauth-Facebook authentication for my Rails app. The authentication

  • 0

I’ve followed Railscast 360 to setup Omniauth-Facebook authentication for my Rails app. The authentication works well, but i’m driving myself crazy trying to pass the scope request for additional permissions. I know they are available as I can manually typed the scope request into the url. I have tried everything and exhausted all google searches.

As suggested in the Railscast comments I have downgraded my Omniauth-Facebook gem to 1.4.0 which to my understanding means the scope cannot be passed as a hash from the Omniauth initializer but instead via the javascript. Neither work for me, but unlike the comments i’m running coffee script as per the Railscast, i’ve tried various placements for scope in this but either get errors or incomplete results….i.e. just email, no user_events etc.

I realise there’s no code here, but it’s exactly as per the railscast.

Can anyone who’s also followed the same Railscast offer any advise on either fixing the issue with 1.4.1 so I can pass the scope hash from the initializer OR how to correctly pass it when running 1.4.0.

Massive thanks in advance!

UPDATE:
I’m kind of getting somewhere! But it’s not quite right. Any pointers would be really appreciated.

In my Omniauth initializer I have:

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :facebook, 'app_id', 'secret_id', {:scope => 'user_birthday,user_events,email'}
end

(With real ids inserted!)

I can then seem to make the correct request by placing the word scope into FB.Init within the coffeescript:

jQuery ->
  $('body').prepend('<div id="fb-root"></div>')

  $.ajax
    url: "#{window.location.protocol}//connect.facebook.net/en_US/all.js"
    dataType: 'script'
    cache: true

window.fbAsyncInit = ->
  FB.init(appId: 'app_id', cookie: true, scope)

  $('#sign_in').click (e) ->
    e.preventDefault()
    FB.login (response) ->
       window.location = "/auth/facebook/callback"  if response.authResponse    

  $('#sign_out').click (e) ->
    FB.getLoginStatus (response) ->
      FB.logout() if response.authResponse
    true

(Again with real appid inserted above)

However, this stops the popup working so i’m pretty sure i’ve placed scope incorrectly. The other examples I have seen place it in FB.login but my attempts to place there have either thrown errors or simply do not work.

Help! 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T02:20:30+00:00Added an answer on June 12, 2026 at 2:20 am

    Managed to solve this. It was the coffeescript that was throwing me. The try coffeescript tool at http://coffeescript.org/ was very helpful.

    The correct placement of scope is as follows:

      $('#sign_in').click (e) ->
        e.preventDefault()
        FB.login ((response) ->
          window.location = '/auth/facebook/callback' if response.authResponse), scope: "email,user_events,user_location,user_birthday"
    

    Hope this helps some others.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We're building an app, our first using Rails 3, and we're having to build
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
This could be a duplicate question, but I have no idea what search terms
Seemingly simple, but I cannot find anything relevant on the web. What is the
I want to construct a data frame in an Rcpp function, but when I
I am writing an app with both english and french support. The app requests

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.