devise_rpx_connectable icon indicating copy to clipboard operation
devise_rpx_connectable copied to clipboard

Not able to login through facebook and google using same email

Open neerajsingh0101 opened this issue 15 years ago • 8 comments

Thanks for the gem. It works nicely except in one scenario.

In my app email address is key so I have setup such that email must be provided.

I first login through facebook with email [email protected] . So now I have a record in the database for john. I use before_rpx_auto_create hook.

Now if I login through google.com using the same email address [email protected] then even though the rpx box says I am loggin through google.com the signed_in? method of devise returns false.

Any thoughts on this issue.

Thanks

neerajsingh0101 avatar Sep 17 '10 19:09 neerajsingh0101

Yeah.

Currently the plugin uses the RPX identifier to authenticate and to create new users in the database. This identifier is unique and links to 1 user on 1 social network.

So if you login using 3 different social networks, it will create 3 different users even if the popup remembers the old connection and you use the same email address for each social network...

Like written in the README TODO, it should be possible to implement some kind of multiple account mapping. The author of authlogic_rpx wrote some kind of implementation.

The first thing we should do is to store the rpx_identifier in a separate table. So one user may have multiple rpx_identifiers. Then, we could write some strategy : for example, like the feature you want to implement : a new connection with a new rpx identifier but using an existing email address could be linked to the existing user...

If you work on this, I'll accept your contributions...

nicolasblanco avatar Sep 17 '10 23:09 nicolasblanco

So if you login using 3 different social networks, it will create 3 different users even if the popup remembers the old connection and you use the same email address for each social network...

My experience was that if one user [email protected] is logged in through facebook and if John tries to log in through google then another record is not created. Also John is stuck and is not logged in.

neerajsingh0101 avatar Sep 18 '10 01:09 neerajsingh0101

I'm willing to work on patch once I understand the strategy and what needs to be done.

neerajsingh0101 avatar Sep 18 '10 01:09 neerajsingh0101

you need to pay for rpx, and implement single signon

danieljohnmorris avatar Sep 22 '10 17:09 danieljohnmorris

As said danieljohnmorris, it appears Account Mapping is only available in the Plus account ($10/mo).

raid5 avatar Sep 28 '10 18:09 raid5

Does that mean when having a Janrain Plus account that feature would work automatically, or are there additional modifications of devise_rpx_connectable needed?

medihack avatar Oct 10 '10 22:10 medihack

No you do not need the Janrain Plus, I am currently working on making a fix myself which I can contribute once it's done. But mine will not use has_many :identifiers so that it may be backward compatible, but it can easily be added and I might just do that.

TheEmpty avatar Nov 03 '10 12:11 TheEmpty

Fixed: https://github.com/TheEmpty/devise_rpx_connectable

TheEmpty avatar Nov 03 '10 17:11 TheEmpty