记住使用OmniAuth登录 [英] Remember login with OmniAuth

查看:83
本文介绍了记住使用OmniAuth登录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用OmniAuth轻松实现记住我"功能?我正在使用Facebook,Identity和LinkedIn,并且正在寻找一种方法来保持用户跨会话登录到我的网站.

Is there an easy way to implement "remember me" functionality with OmniAuth? I'm using Facebook, Identity and LinkedIn, and I'm looking for a way to keep the user logged in to my site across sessions.

推荐答案

基本上,您在客户端上设置了另一个保留用户ID的cookie.然后,使用该用户ID在后续访问中使用户登录(或至少识别出他们).请记住,Omniauth只是进行身份验证,而不是会话管理,因此您需要在Omniauth外部进行此操作.

Basically you set another cookie on the client which persists the userid. Then use that userid to sign the user in (or at least recognise them) on subsequent visits. Remember Omniauth just does authentication, not the session management stuff so you need to do this outside Omniauth.

请查看gareth-simpson对这个问题的答案:实施的记住我"在Rails应用程序中

Look at the answer by gareth-simpson to this question: Implementation of "Remember me" in a Rails application

这篇关于记住使用OmniAuth登录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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