Take the 2-minute tour ×

Is there a way I can integrate authentication from a legacy system to a couchapp?

I mean, I have a system with user-accounts and all, and it's written in some legacy languages, and it should not matter which they are. However life go on, and I would like to utilize magnificent tools like couch. But I don't want to port all my system to couch - it will take forever and will never happen!

What I want to do is develop whatever new modules I can over couch, and let it work in accord with the original legacy system, utilizing the existing authentication and session mechanism, and providing new functionality over it.

What are my options?

If you need more information - ask.

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

Depending on how your legacy system operates, I can see a couple of approaches:

  1. Use your legacy system as a proxy. Have the users login to the legacy system as normal, hit it's dashboard, and have a link to the new 'features'. That link will take them to a url in the legacy system that just proxies requests and responses back to the couchapp.

  2. You can do Cookie Authentication. You would have to copy all your legacy users into the _users table in couch. In your legacy app, on login (from your legacy server to couch) post the login details to _session, get back the cookie, and then set that cookie on the browser. Then the user could navigate between your two apps, as long as you have hostnames that work for the cookie.

  3. If your legacy system cant be modified, but it sets a session cookie, you could stick a proxy in front of your couchapp that looks for the cookie, or redirects to your legacy login.

  4. You could create your own couch authentication module (prob a lot of work).

Hope these ideas help. All have different pros and cons.

share|improve this answer
the general directions are clear, and are more or less what I could figure by myself. 1 is out of the question. 2 is interesting in simplicity, however, implies a gigantic data-redundancy between the systems. Can you elaborate/give more leads on 3 and 4? –  Radagast the Brown Jan 18 '12 at 13:16
add comment

Your Answer


