Connecting ios app to a rails app that uses pow and devise - ios

I want to make an ios app that can create/login users and is linked to a Rails api that uses devise. I've tried using Restkit and AFNetworking but am having some trouble. I understand fetch and pull requests but am not sure how to use tokens to create/login users.
I have a rails api that uses pow built from this tutorial:
http://apionrails.icalialabs.com/book
Does anybody have any advice/examples that can get me going in the right direction?

Related

React Facebook oAuth with devise_token_auth on Rails

I am attempting to use Rails 5.0.5 API only with devise_token_auth to build a React app. I have the Rails API server running locally on :3001, and my react app (running from within /client folder) is running on :3000.
I am able to register/login/etc. with email/password using axios and API calls, but the oauth is giving me some trouble. It seems that it doesn't want to work with React and the API situation, it loads up a new tab, authenticates with Facebook, then goes to the callback controller on my rails server (:3001). I'm unable to figure out a way for the callback info to be returned to my React app on :3000.
I am able to query facebook manually and receive back the info I need; is there a way to manually create a user based on the Facebook data that will allow me to use devise/devise_token_auth? Do any of you have any better methods for authentication on a React app using Rails API as a backend? I'm pretty new to all of this and not too far into the project, I'm ready to jump ship to a better solution if it exists! Thank you for any information. Please feel free to ask me any questions.

Is there any documentation for Google Cloud Messaging with Ruby on Rails?

Currently I'm working on a project that requires me to send push notification via GCM; on the server side I'm using Ruby on Rails. I am unable to find any proper tutorial or documentation for the same.
I have no idea on how how should I go by writing models for GCM users with userids / device id mapping. What should I do in case the user in logged out of the app or two users use the same devisce and same app?
Please refer to this tutorial for creating your server using Ruby On Rails. This tutorial also provides the code for the Android Client.
Here is another sample tutorial GCM code with server created using Ruby on Rails and the client code is an android app.

How to use devise gem to be the Oauth Provider of another app

Basically what I have now are 2 apps, 1 is php and the other one is rails. The rails app is the main app at the moment and contains all the user info, since I'm having a new php based app, I'd like to skip the whole registration and authentication part on php and immediately have it authenticate on the rails app instead via devise.
Are there any good reading materials or anyone can guide me here on how to properly do this?

Rails3: How to secure an Api

I've a Rails app and now I'm building a phonegap app for mobiles.
My idea is create an API in my Rails app and the mobile app will be able read the json responses of my api controllers like in the #350 RailsCast tutorial:
http://railscasts.com/episodes/350-rest-api-versioning
In the Rails app, I've users, and they can register and login with Devise gem. For securing my API I read the #352 RailsCast tutorial:
http://railscasts.com/episodes/352-securing-an-api?view=asciicast
My question is if is possible securing my API somehow with Devise, because I want my users will be able register or login through phonegap app and if they log in the app successfully, they will be able read the json responses.
Someone knows tutorials about this?
Is better using also Oauth2 or only with Devise gem is possible?
thanks.
Here is a tutorioal of Google calendar with nice Omniauth 2.0 issues
http://blog.baugues.com/google-calendar-api-oauth2-and-ruby-on-rails

rails facebooker vs facebook js sdk

I am exploring facebook integration with my rails app and wondering what is the best practice for rails applications.
1 - Is js sdk the better route or the facebooker gem? I would like to allow users to login via facebook, post content/links to their walls, see friend activity in the application, invite fb friends, from the rails app etc.
2 - Can either of these methods be tested locally or do I need a hosted internet app?
3 - I already do fb authentication for login using janrain/rpx-now via authlogic-rpx plugin. Will this have any conflict with the facebooker gem or the fb js sdk. And..in order to use the fb pluging/js sdk/facebooker etc, is it required to do the authentication via those methods or can I authenticate via rpx/janrain but access feeds/friend activity etc from the facebooker gem/js sdk etc?
Thanks
1) I often use both. I find most of the work to be easier using the server side SDK, but we do occasionally use the js one as well. I would check out Facebooker2, it's much more simple than the original Facebooker
2) Both can be used locally, but you do need internet connectivity to talk to Facebook.
3) If you get a valid access token, you can use Facebooker with the RPX stuff. You would need to change the way you do the client setup.

Resources