Reputation: 325
I have an application running Rails 4, Devise and Omniauth (Facebook). Everything works fine.
Now I want to create an IOS app to access this database. I planned to do this using JSON requests to fetch and post data to Rails RESTfull resources that I have.
Before I start writing the IOS app, I tried to test retrieving data from the web app, using cURL on command line (JSON requests), but Devise always reject me saying that I have to authenticate first.
How should I do this? How to authenticate, using JSON requests, using Facebook username/password and access the data from the Rails app?
Or am I thinking all wrong and I should do this in a different way?
Upvotes: 2
Views: 784
Reputation: 473
gem "koala"
or other for access to facebook api using this "access token".'
6.1 As first step you must get user information from facebook. (you will have facebook UID, and may be email.)
6.2 Then you must find current user in your DB and login using Devise method sign_in
Also you have to seen this gem https://github.com/lynndylanhurley/devise_token_auth
Upvotes: 2