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 7723617
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T04:29:11+00:00 2026-06-01T04:29:11+00:00

I am a beginner with Ruby and Rails but I managed to use OmniAuth

  • 0

I am a beginner with Ruby and Rails but I managed to use OmniAuth for authentication via Facebook. Everything works fine, I am able to create users and they are able to login with Facebook.

The problem is, I would like to take some of the user data (such as email, profile photo, etc.) and save it.

Going through the README (https://github.com/mkdynamic/omniauth-facebook), I managed to find:

Here’s an example Authentication Hash available in request.env[‘omniauth.auth’]:

{
  :provider => 'facebook',
  :uid => '1234567',
  :info => {
    :nickname => 'jbloggs',
    :email => 'joe@bloggs.com',
    :name => 'Joe Bloggs',
    :first_name => 'Joe',
    :last_name => 'Bloggs',
    :image => 'http://graph.facebook.com/1234567/picture?type=square',
    :urls => { :Facebook => 'http://www.facebook.com/jbloggs' },
    :location => 'Palo Alto, California',
    :verified => true
  }
} 

I tried to do more searching on the Authentication Hash and got this which lists some of the information that can be fetched: https://github.com/intridea/omniauth/wiki/Auth-Hash-Schema

The thing is, I asked for certain permissions. The question is, how do I know what sort of information Facebook is sending? Unfortunately, saying the info is in request.env[‘omniauth.auth’] does me not much good. How do I fetch the information from here?

I am a real beginner going through the Rails tutorial (http://ruby.railstutorial.org/) but trying to create my own app by trial and error.

  • 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-01T04:29:13+00:00Added an answer on June 1, 2026 at 4:29 am

    request.env[‘omniauth.auth’] will give you a hash. Check the Ruby docs for what you can do with a hash.

    http://ruby-doc.org/core-1.9.3/Hash.html

    For any elements that are not always going to be there you can just check for blank? (a Rails convenience method), e.g.

    omniauth = request.env['omniauth.auth']
    unless omniauth['info']['email'].blank?
      send_spam omniauth['info']['email'] # ;)
    end
    

    You would probably find the following screencast useful if you haven’t seen it already:

    http://railscasts.com/episodes/235-omniauth-part-1

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

Sidebar

Related Questions

I am a beginner to ruby on rails.But i am quite comfortable with php,
I am beginner of Ruby on Rails and use Windows for development. I do
I'm a rank beginner with Ruby and Sinatra, but have managed to come up
I am beginner in ruby + rails. I have problem to get values in
I'm still a beginner with ruby and rails, and now I'm googling about methods
I'm a ruby/haml/sass-beginner. I just installed ruby and rails for windows, haml, and sass
I'm a beginner at Ruby On Rails and am trying to get a migration
I'm a beginner of Ruby and Rails, so this is probably an easy question.
I am a beginner when it comes to Ruby on Rails, so I need
I'm a beginner and am confused by the structure of ruby on rails. Everywhere

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.