Single logon with different applications approach ruby on rails

后端 未结 1 1719
遥遥无期
遥遥无期 2021-01-03 05:08

What would be the best approach in the following situation:

  • Main application that handles authentication of users (preferably Devise).
  • Several differe
相关标签:
1条回答
  • 2021-01-03 05:48

    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.

    0 讨论(0)
提交回复
热议问题