ruby-on-railshttp-authenticationrhomobile

How should I handle user validation through Rhodes (without RhoConnect/Sync)?


I have a site build on rails that provides XML version of all relevant pages. Additionally, it has HTTP authentication.

My plan to handle login for the mobile app is to post the username/password to the login page and, assuming I get a good response, I'll set global variables variables for user and password and make all requests to protected data with the validated user/pass in the header. Logout will just wipe wipe the user/password global variables.

Is the best way to handle this or am I making things more difficult than they need to be?


Solution

  • yes, although my advice is to use a gem like Devise or authLogic as rolling your own authentication is fraught with potential problems.

    There are different ways you can include external libraries for Rhodes, including RubyGems and custom extensions. Please refer to the link below for information.

    http://docs.rhomobile.com/rhodes/extensions