Mobile App webframe Authentication with Rails Devise Mobile App webframe Authentication with Rails Devise ruby ruby

Mobile App webframe Authentication with Rails Devise


You might want to consider using Devise Token Auth and treating your mobile application like just another webapp that requests permission from your main site. DTA is particularly nice since it takes care of managing the session tokens (renewing/expiring) and passing them onto the app requiring access. The issue is overriding your session controllers so that it automatically logs in after you already log in on the mobile app (or just rewriting your log in so it occurs in conjunction with the Rails site, rather than before). Considering you're already using Devise, this may also be more refactoring than you'd like.


If you want to put your authentication form on the mobile UI and pass the credentials over to the web frame, you need a way to pass data from the mobile app to the web frame.

How you accomplish this depends on what platform you're building on. I'm not really a mobile developer so I don't know for certain how difficult / easy these options are:

  1. When opening the web frame, instantiate it with session data
  2. Find a way to call methods on the client from the web frame. Something like getSessionData.
  3. You could generate a fingerprint for the web frame, have the mobile UI send this data to the server, and then have the web frame authenticate with the server by sending the fingerprint.

Again, I'm not entirely sure how possible all these options are.


You should use token authorization and Android deep linking. It will allow you to login in the web browser and send a token to your app via deep linking.