[英]How to accomplish multiple authentication using Devise Omniauth + (Facebook , Twitter, Google )?
I have implemented the Devise Omniauth authentication in my Rails application successfully using the following tutorial by git OmniAuth: Overview 我已经使用git OmniAuth的以下教程成功地在我的Rails应用程序中实现了Devise Omniauth身份验证:概述
But it will not support multiple authentications , may be you all know that , and have faced the same issue before, but if you people have tweaked the same problem successfully please let me know the solution . 但是它不支持多重身份验证,也许你们都知道,并且以前遇到过同样的问题,但如果你们有人成功地调整了同样的问题,请告诉我解决方案。
This is the scenario that i need to accomplish using Omniauth + Devise. 这是我需要使用Omniauth + Devise完成的场景。
we have a user named John and he already have accounts in both Google & Facebook with the same email id "John@yopmail.com". 我们有一个名为John的用户,他已经在Google和Facebook上拥有相同的电子邮件ID“John@yopmail.com”。
So for the first time John trying to log-in with his Google account, john have successfully logged in this time. 因此John第一次尝试使用他的Google帐户登录,这次john已成功登录。
but for the second time john trying to log-in with his facebook account, this time our application redirects john to the devise registration_url , without letting him signing in with his facebook account. 但是约翰第二次尝试使用他的Facebook帐户登录,这次我们的应用程序将john重定向到设计registration_url,而不让他用他的facebook帐户登录。
I know why this is hapepnig because devise will internally validates the uniqueness of email.But i am very curious to know that , is there any way to tweak this issue so that we can achieve multiple authentications . 我知道为什么这是hapepnig,因为设计将在内部验证电子邮件的唯一性。但我很好奇,有没有办法调整这个问题,以便我们可以实现多个身份验证。 Stack-Overflow have done the same very nicely. Stack-Overflow也做得非常好。
Please help me to find out the solution. 请帮我找出解决方案。
Thank you.. 谢谢..
try this, in your devise.rb
file comment this line or change email and use difference for that and then try 试试这个,在你的devise.rb
文件中注释这一行或更改电子邮件并使用差异然后尝试
# to authenticate or find a user. Default is :email.
config.case_insensitive_keys = [ :email ]
# modifying a user and when used to authenticate or find a user. Default is :email.
config.strip_whitespace_keys = [ :email ]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.