使用不同应用程序的单点登录方法 ruby​​ on rails [英] Single logon with different applications approach ruby on rails

查看:17
本文介绍了使用不同应用程序的单点登录方法 ruby​​ on rails的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在以下情况下最好的方法是什么:

What would be the best approach in the following situation:

  • 处理用户身份验证的主要应用程序(最好是设计).
  • 几个不同的应用程序可以访问用户数据库以进行单点登录.
  • 同步用户数据(首选项、个人资料数据)

场景示例:

  • 用户注册应用程序 A
  • 用户可以使用相同的凭据访问应用程序 B(但必须明确确认新协议才能使用应用程序 B)

推荐答案

首先,所有的应用程序都需要访问用户数据库,所以用户只需要注册一次.您可以使用属性或关系来检查用户是否已确认不同应用的协议.

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.

例如,您可以将 memcached 用于会话存储,并在所有应用中使用相同的会话存储密钥.如果用户在一个应用中登录,当他在没有关闭会话的情况下转到另一个应用时,该应用可以检查会话是否已创建,用户无需登录即可进入新应用.

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.

这篇关于使用不同应用程序的单点登录方法 ruby​​ on rails的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆