Question

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.

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top