I have not found a good way to do this. I don't use :omniauthable , I use OmniAuth and Devise separately, as shown in the Railscast episode, where there are two users and authentications tables. This is a kind of hack and works only for Facebook.
Basically, send your access_token from iPhone to the server via SSL or something similar. You must check with OmniAuth first, and if you are granted access, you can manually create a session with OmniAuth by going something like:
I managed to work something by doing this, though:
FB = OmniAuth::Strategies::Facebook.new("nothing") client = ::OAuth2::Client.new("nothing", "nothing", FB.client_options) cached_token = "app_id_part|session_id_part|token_part"
After that, you look at the user information that you need to find in your Authentication table:
@user = Authentication.where(:uid => FB.auth_hash["uid"], :provider => "facebook").first.user
Now we create a session:
sign_in_and_redirect(:user, @user)
source share