views:

82

answers:

3

I have a Flex UI that will need to connect to Rails. How do I manage authentication and only authenticated user's can connect and see their own data only? UPDATE: And how would I do this if I should not want to use RubyAMF (right or wrong)?

A: 

Check out RubyAMF, it is super easy to set up and use and enables you to call controller methods directly from flash and return actionscript objects.

homepage: http://blog.rubyamf.org/
google code: http://code.google.com/p/rubyamf/

greg
A: 

First, for RubyAMF, check out this link: http://unitedmindset.com/jonbcampos/2009/05/30/ruby-on-rails-with-flex/

Next, for the authenticated users, just use Restful Authentication, a ruby plugin: http://techno-weenie.net/2006/8/1/restful-authentication-plugin

If you make the smallest change to the authentication failed function in the plugin, your app with throw fault events when a user tries to access a service that they aren't authenticated to access.

jonbcampos
+1  A: 

I would say auth_logic might be a better plugin for handling authentication. If you use RubyAMF with auth_logic you will make a call to UserSession.create and pass in the username and password. You may also want to check out Weborb for communicating with Flex, it uses RTMP and depending on your needs it may be a better fit.

emullet
Helpful. Thank you.
NJ