Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 450601
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T21:53:07+00:00 2026-05-12T21:53:07+00:00

I’ve seen the question asked a few times on the Google groups but no

  • 0

I’ve seen the question asked a few times on the Google groups but no one seems to follow-up with an answer or solution.. Is it possible to use a central database for User creation and authentication from multiple Rails applications using Authlogic?

It isn’t an option for me to use OpenID right now, I’d love to but my client does not support it yet.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T21:53:07+00:00Added an answer on May 12, 2026 at 9:53 pm

    It seems that there still hasn’t been a solution posted to the original question.

    I had a similar problem. I had multiple rails applications and I needed to be able to track users between activity on all of them. So, I wanted to have a single application for managing users and tracking and all the other applications would connect to this user database to authenticate.

    I was already using Authlogic for some other projects, so I was hoping that it would be as simple as changing some configuration settings.

    Here’s My solution:

    I created the main user tracking application. There was nothing special about the application. It allowed users to register, log in, log out, etc. Once users were logged in they could then navigate to the other apps.

    In the environments.rb file of my user application and every application needing to authenticate with the base application, you need to set up the session key and domain to be the SAME.

    config.action_controller.session = {
      :session_key => '_my_app_session',
      :secret      => '_long_secret_session_key_here',
      :domain => ".basedomain.com" 
    }
    

    Each of my applications are under their own subdomain, such as app1.basedomain.com app2.basedomain.com
    I’m not sure if this would work otherwise without some more changes.

    In each application, Create the UserSession

    class UserSession < Authlogic::Session::Base   
    end
    

    and User models.

    class User < ActiveRecord::Base
       establish_connection "users_database"
       acts_as_authentic 
    end
    

    What is different in this User model is that it now has the establish connection method. the “users_database” is in the database.yml file and points to the database for the central user management application.

    I didn’t go as far as having log in and log out throughout my sub-applications, but if you did you would have to create the UserSessionsController as well.

    In each application that uses authentication, I included some helper methods in the ApplicationController, for example,

       def current_user_session
          return @current_user_session if defined?(@current_user_session)
          @current_user_session = UserSession.find
       end
    
       def current_user
          return @current_user if defined?(@current_user)
          @current_user = current_user_session && current_user_session.record
       end
    
       def require_user
         unless current_user
           store_location
           redirect_to 'http://main_user_login_page'
           return false
         end
       end
    

    Then I can use ‘require_user’ in my controllers where I want authentication just like I can in my main user application.

    Hope this helps.

    Chase M Gray

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 240k
  • Answers 241k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Roman Nurik's answer is almost correct. View.OnClickListener() is actually an… May 13, 2026 at 7:19 am
  • Editorial Team
    Editorial Team added an answer Under the circumstances, I'd probably use a listbox. You can… May 13, 2026 at 7:19 am
  • Editorial Team
    Editorial Team added an answer It's not lazy evaluation. It's conditional evaluation. Special form (if… May 13, 2026 at 7:19 am

Related Questions

I've got a string that has curly quotes in it. I'd like to replace
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I have a French site that I want to parse, but am running into
I have text I am displaying in SIlverlight that is coming from a CMS

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.