Hello, I need to write a Rails application with user authentication. This is no problem so far, but the company that needs the rails application does have a large user database that is used for an already existing application. In the new Rails application, there are four types of users with different rights. The existing users should be equal to one of these types. When authenticating, the Rails application should first try to find the user in the own database. If this step fails, it should try to authenticate the user against the Oracle Database. So is it possible to connect to a MySQL database for data storage and additionally connect to an Oracle DB for user authentication? Even if the database scheme in the Oracle DB is fixed, does not comply with ActiveRecord standards and can''t be changed? Any help on this topic is appreciated. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
François Montel
2007-Jan-09 21:19 UTC
Re: Connect to two databases / Delegate authentication?
Code Xy wrote:> Hello, > > I need to write a Rails application with user authentication. > > This is no problem so far, but the company that needs the rails > application does have a large user database that is used for an already > existing application. > > In the new Rails application, there are four types of users with > different rights. The existing users should be equal to one of these > types. > > When authenticating, the Rails application should first try to find the > user in the own database. If this step fails, it should try to > authenticate the user against the Oracle Database. > > So is it possible to connect to a MySQL database for data storage and > additionally connect to an Oracle DB for user authentication? Even if > the database scheme in the Oracle DB is fixed, does not comply with > ActiveRecord standards and can''t be changed? > > Any help on this topic is appreciated.You can create another model that uses ActiveRecord::Base.establish_connection (see api) to connect to your OracleDB, and then query that model if search in the Rails app DB fails. See also here: http://wiki.rubyonrails.com/rails/pages/HowtoUseMultipleDatabases -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks, I did not know they cover this in the wiki! François Montel wrote:> You can create another model that uses > ActiveRecord::Base.establish_connection (see api) to connect to your > OracleDB, and then query that model if search in the Rails app DB fails. > See also here: > > http://wiki.rubyonrails.com/rails/pages/HowtoUseMultipleDatabases-- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---