4

What would be the best approach in the following situation:

  • Main application that handles authentication of users (preferably Devise).
  • Several different applications that can access user database for single logon.
  • Synchronisation of user data (Preferences, profile data)

Scenario example:

  • User registers for application A
  • User can access application B with same credentials (But has to explicitly confirm a new agreement before it can also use application B)
Laurens
  • 2,420
  • 22
  • 39
  • Have you already looked into OAuth gems like doorkeeper? https://github.com/applicake/doorkeeper – jtesch Jul 05 '12 at 19:53
  • I think you need to clarify whether these 'associated' apps can access the database of the authentication app or not? Are they hosted on the same server-stack? – Saurabh Nanda Jul 15 '12 at 14:39
  • I'm currently using the doorkeeper gem as oauth2 provider and 2 clients, this enables me to use a single sign on solution with a custom oauth strategy, the one problem I still need to tackle is that it shouldn't automatically login to ALL clients at once, but has to check first if a user has authorized the specific app that it logs in to. (Like google does with adsense etc.) – Laurens Jul 17 '12 at 09:57

1 Answers1

0

First of all, all the apps need to have access to the users database, so the users only need to register once. You can have an attribute or relation to check if the user has confirmed agreements for different apps.

For making all the apps accesible with only one login, you can use the same session store for all the apps.

For example you can use memcached for the session store and use the same session store key in all the apps. If the user makes login in one app, when he goes to another app without closing the session, this app can check that the session has been created and the user can enter in the new app whithout login in.

With this solution you need to be careful with the session data, so the data of one app doesn't overlap the data of other app.

HED
  • 94
  • 1
  • 4