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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:45:37+00:00 2026-05-27T09:45:37+00:00

Can i get in params twitter email using devise :omniauthable ? I can get

  • 0

Can i get in params twitter email using devise :omniauthable?

I can get facebook email and create user with this method:

def self.find_for_facebook_oauth(access_token, signed_in_resource=nil)
  data = access_token['extra']['user_hash']
  if user = User.find_by_email(data["email"])
    user
  else # Create a user with a stub password.
    User.create!(:email => data["email"], :password => Devise.friendly_token[0,20])
  end 
end

controller:

class OmniauthCallbacksController < Devise::OmniauthCallbacksController

  def facebook
    @user = User.find_for_facebook_oauth(env["omniauth.auth"], current_user)
    if @user.persisted?
      flash[:notice] = I18n.t "devise.omniauth_callbacks.success", :kind => "Facebook"
      sign_in_and_redirect @user, :event => :authentication
    else
      session["devise.facebook_data"] = env["omniauth.auth"]
      redirect_to new_user_registration_url
    end
  end

  def twitter
    @user = User.find_for_twitter_oauth(env['omniauth.auth'])

    if @user.persisted?
      flash[:notice] = I18n.t 'devise.omniauth_callbacks.success', :kind => 'Twitter'
      sign_in_and_redirect @user, :event => :authentication
    else
      flash[:notice] = I18n.t 'devise.omniauth_callbacks.failure', :kind => 'Twitter', :reason => 'User not found'
      redirect_to new_user_session_path
    end
  end
end

if i using something like this for twitter oauth in incoming params i got user_id, uid, credentials, secret, etc… but there is no email. Can I get it using this way? I don’t want add new fields for users table or add new table with user ids, oauth prowiders, and oauth ids.

Mb more cleanest way exist with warden strategy for twitter?

  • 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-05-27T09:45:38+00:00Added an answer on May 27, 2026 at 9:45 am

    the Twitter API DOES NOT return emails, so its up to you how to handle that

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

Sidebar

Related Questions

I am using the Tweetstream gem to retrieve statuses from Twitter. This works: Tweetstream::Client.new('user',
//gets the correct User (checked with printlns) def user = User.get(params.user?.toString()) println usern.nickname +
How can i get All my followers with one request? If i do $this->twitter->getFollowers();
trace($this->_classResources,'$this->_classResources'); If I can get $this->_classResources then I don't need the second params.
I can get the element like this $(#txtEmail) but I'm not sure how to
In get_data action ,there are some code like this: def get_data if params[:p]=='1' raise
I have a tweets_controller #called when user submits twitter form def message unless current_user
I have a php script which can take some GET params. I would like
I can access this webpage in my firefox browser: http://www.ip-adress.com/ip_tracer/74.82.190.99 So I can get
Can anyone tell me how to create multiple records in grails. This class is

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.