title: How do I add a custom Devise/Warden authentication strategy for use with ActiveAdmin?
body: <p>I'm trying to build a SSO system where a bunch of Rails 4 apps under different subdomains share a common cookie. I've got 4 apps doing authentication via the sorcery gem and 2 apps using ActiveAdmin and Devise.</p>
  
  <p>The 4 apps using Sorcery are working as expected, I can get a successfully signed on user to access all 4 different apps using the same session cookie.</p>
  
  <p>I'm having trouble with the 2 Devise/ActiveAdmin apps. I added a custom Warden authentication strategy and configured Devise to use it. But I don't think the strategy is being used because I continue to get 401 unauthorized errors and any puts statements/logging in the authenticate! method below is never seen. Anyone with previous experience doing this? Or maybe some help tracing through where the authentication steps are happening so I can try to add some logging?</p>
  
  <pre><code>Warden::Strategies.add(:gc_auth) do
    def valid?
      true
    end
  
    def authenticate!
      user = AdminUser.find_by_uuid(session[:user_uuid])
      user ? success!(user) : fail!("Not signed in") 
    end
  end
  
  
  
  config.warden do |manager|
    manager.default_strategies.unshift :gc_auth
  end
  </code></pre>