How to use a single account after signing up with Meteor.accounts of different services?

211 views
Skip to first unread message

Tsegaselassie Tadesse

unread,
Feb 13, 2014, 2:52:51 AM2/13/14
to meteo...@googlegroups.com
I'm using Meteor's Login With External Services, I want to know how to integrate the different external accounts of one user (using the same email address for all external services). That is s/he can have a normal Meteor account having a particular email say, us...@example.com. Then s/he uses the different services (Google, Facebook and Twitter) to login. In all external accounts s/he uses the same email, that is us...@example.com, so whenever the user logs into my application, s/he should see the same account. 

I've tried that with my application but it looks like it creates different accounts for different services. Is there a way to have on single account but be able to login using different services?

Thanks,
Tsega

Serkan Durusoy

unread,
Feb 13, 2014, 4:23:39 AM2/13/14
to meteo...@googlegroups.com
There are some nice discussions around this subject:


just take a look at the top few hits and you'll find some working solutions :)

Basically, you'll need to hook into Accounts.onCreateUser to check for email address and then abort user creation to continue with a manual merge.

But it will be a problem with twitter since twitter does not publish email addresses.

Tsegaselassie Tadesse

unread,
Feb 13, 2014, 4:40:24 AM2/13/14
to meteo...@googlegroups.com
Thanks Serkan,

I was actually reading your post on "ObjectID in built in user collection" topic and saw the suggestion from Abigail about using the hook on Accounts.onCreateUser. Apply that to my problem actually makes sense, I actually found this "Merging OAuth Accounts" linked in of the posts here. Anyways, I've got exactly what I'm looking for but like you said since Twitter is does not publish email addresses, I'm going to remove from the list of login services. 

Thanks again!

Serkan Durusoy [DNA | encoding the future]

unread,
Feb 13, 2014, 4:44:18 AM2/13/14
to meteo...@googlegroups.com
I'm glad you got a working solultion and I'm ashamed I have not pointed
towards the excellent meteorpedia :(

Also, your post makes me wonder, how would one go about adding/merging
accounts to an already logged in user. This is a common pattern where a
user account is created using email, password etc and then they are
expected to click on few buttons to merge in accounts from different
services for general social integration.

This would then solve the twitter edge case.

Gadi Cohen

unread,
Feb 13, 2014, 5:23:37 AM2/13/14
to meteo...@googlegroups.com
Haha.  Actually at the end of the Meteorpedia article, there's a note to Tim Haine's work to seperate OAuth stuff login logic, so they can be used seperately for this kind of stuff, but the dev needs to implement the integration his/herself.  Also, from a quick look I couldn't find any documentation on it... if anyone knows anything, please point it out.

When I did the Meteor Usermap quickie, I had need to get extra info from facebook, google & github.  In this case, I also used it at login time, but the way it's implemented it could be used at any time.  The implementation unfortunately was via npm modules for all of these, and not via the Meteor packages (as per the note above), but it works great.  See the accounts.js on github.  A little bit hacky though.

I'd love to (when time allows) create a smart package for all the above, and some other things I've come across.  Unfortunately no time at the moment :(

Serkan Durusoy [DNA | encoding the future]

unread,
Feb 13, 2014, 5:54:23 AM2/13/14
to meteo...@googlegroups.com, meteo...@googlegroups.com
Great pointer, thanks!

I'm indeed looking for something like this also because I want to implement incremental permission requests.

I really don't like the idea of requesting all permissions at first but request them gradually as the user hits the parts of the app that require specific permissions, that way it also gains some context and the user is more likely to authorize, or if they don't, it is not expense of total rejection.

Sent from my iPhone


--
You received this message because you are subscribed to a topic in the Google Groups "meteor-talk" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/meteor-talk/izuRBdGgxxg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to meteor-talk...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Reply all
Reply to author
Forward
0 new messages