Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Link accounts to meteor user (co-create with Ian Serlin) #1133

Closed
wants to merge 3 commits into from

Conversation

yubozhao
Copy link

@yubozhao yubozhao commented Jun 8, 2013

Problems:

Meteor account system is currently not supporting the ability to link different external services account(such as Twitter, Facebook) to the same Meteor user. A real life example would be Instagram, where Instagram links different social network accounts with the Instagram account to provide user ability to share pictures over different social networks.

Possible solutions

Running along with Meteor's existing account system and handles the issue when calling the login method (Another Account registerLoginHandler).
Build a link system that is separate from existing login system. It should simplify some process because it is not login, but link.

Solution we choose:

We choose to build a link system that is separate from existing login system, because we felt the features we add on are extend features, not basic. And they should be kept in separate section and have rooms for potential expansion in features. Also, it might be confusing to developers that use loginWith to connect additional services.

What accomplished in this pull request:

if user were first use external service to register Meteor user:

  • User can link and unlink different external service, that is not what user already register with.
  • User can log in this Meteor account with different external service that is linked to the Meteor account.
    for example: user first register Meteor account with facebook account, later on he linked his instagram account. Now he can login this Meteor account with either facebook or instagram accounts that was already linked with Meteor account.
  • User can link password based account to Meteor user (that was created by external service).
    User can log in with the password with that linked Meteor user.

if user were first use password based to register Meteor user:

  • User can link and unlink different external service.
  • User can log in this Meteor account with different external service that is linked to the Meteor account

Error Codes

90000 - "You must be logged into an existing account to link a service."
90001 - "Another user already exist with this service!"
90002 - "Attempt link service already exist."

90003 "You must login to unlink a service."
90004 "You can't unlink password service"
90005 "You can't unlink a non-existing service."
90006 "You can't unlink the only service"

lnkchart

Typical Flow through the Link System

  1. User initiates by calling Meteor.linkWithXXX (service)
  2. Client pops the 3rd party auth window and polls for the window to close
  3. When the user completes auth in the pop-up, two things happen:
    A) the pop-up redirects to a server url and the server captures the returned 3rd party information via Oauth._middleware B) the client detects the pop-up closing and calls the "link" method on the server
  4. The server matches the client with the returned 3rd party information and update's the user's services property in the database

@andreioprisan
Copy link

+1 for this fix, would love to get this merged to master

@garnermccloud
Copy link

+1 for this. This would be a great add to functionality.

@mrzafod
Copy link

mrzafod commented Oct 23, 2013

+100 for this. We have been waiting so long! Thanks!

@alexpods
Copy link

+1000. I need it so much.

@shravansing
Copy link

Hi,

Whats the update and timelines for this one ..
I see this one was pulled 5 months ago ..

@joshorig
Copy link

+1 any updates on timeline/availability?

@fabiozaffani
Copy link

+1, any feedback for this pull?

@BenjaminRH
Copy link

+1 this is a really basic feature that a surprising number of people need to do, considering that all there currently is on the subject is a few confusing StackOverflow answers that provide outdated hacky starting points.

@liamgray
Copy link

I would really like it if this pull request was accepted!

@brianherbert
Copy link

Throwing a +1 in the mix. It would be nice to not have to hack this into every project.

@Elfoslav
Copy link

+1, please!

@crsssl
Copy link

crsssl commented Dec 29, 2013

+1 from me, too. This would solve a lot of problems... ones that all web apps seem to encounter (or are encountering more and more). In fact, I would go so far as to have a whole "Social Accounts" package or system that may or may not necessarily tie back into the Meteor Accounts system. From there you could manage all the users' various online properties using some common interface.

@n-h
Copy link

n-h commented Dec 30, 2013

👍

1 similar comment
@juanbernabo
Copy link

+1

@jagill
Copy link
Contributor

jagill commented Jan 8, 2014

+1

@travishubbard
Copy link

Would be a fantastic add to the product.

@sashasochka
Copy link

+1

@liamgray
Copy link

liamgray commented Feb 3, 2014

Maybe someone could create a meteorite package that does this?

@scottmcpherson
Copy link

+1

@chmac
Copy link

chmac commented Feb 11, 2014

Folks looking for a solution on this might find #1024 useful.

@swese44
Copy link

swese44 commented Mar 27, 2014

Lots of comments from people who need this, how can we make this a priority?

@lirbank
Copy link

lirbank commented Apr 3, 2014

Hey, I have a very simple solution to this that I presented on the last Devshop. Here's the presentation:

https://www.youtube.com/watch?v=RWhbjQ7GeQw&feature=share&t=1h31m4s

It will be available as a Meteorite package shortly (next week)! I'll post the link here again when it's published.

@chmac
Copy link

chmac commented Apr 4, 2014

@lirbank Awesome, looks great. Look forward to the release. :-)

@lirbank
Copy link

lirbank commented Apr 9, 2014

The first beta of accounts-merge https://atmospherejs.com/package/accounts-merge is out!

This example Meteor App https://github.com/lirbank/meteor-accounts-merge-example explains how to use it.

Look forward to your feedback!

@lirbank
Copy link

lirbank commented Apr 9, 2014

@chmac - Thanks, it's out now! https://atmospherejs.com/package/accounts-merge

@glasser
Copy link
Contributor

glasser commented Apr 17, 2014

It's great to see people creating Atmosphere packages to address these concerns outside of core.

Improving this in core is not on our roadmap right now.

@glasser glasser closed this Apr 17, 2014
@PranayShah
Copy link

It only makes sense to me to have it as a part of Meteor Core, especially when there is support for logging in with so many services. No one cares to remember which service they had used to login to a site once. And it is only then when you have got to amaze your users by showing them how seamlessly everything just works.

@Slava
Copy link
Contributor

Slava commented Aug 8, 2014

In case anyone on this thread missed it: @yubozhao reimplemented this functionality in a stand-alone package: http://atmospherejs.com/package/link-accounts

And you can find his talk about it here: https://www.youtube.com/watch?v=AsEn0xH_TfA&list=UU3fBiJrFFMhKlsWM46AsAYw

@pscanf
Copy link

pscanf commented Sep 13, 2014

Well, had I known it before! 😄

I just finished implementing the same thing in another package. The functionality is a bit different, so it may be worth taking a look.
https://atmospherejs.com/mondora/connect-with

o/

@lirbank
Copy link

lirbank commented Feb 27, 2015

I've updated accounts-merge to be compatible with Meteor's new packaging system (i.e. works with Meteor 1.x+) https://atmospherejs.com/mikael/accounts-merge

@MichaelJCole
Copy link
Contributor

@glasser I'm very new to Meteor. I've been looking at merge requests, probably outdated blogs, and multiple packages (some which seem to duplicate functionality). I'm still not clear on how to get this all to work. Why is this in core if you're not improving it?

@graemian
Copy link
Contributor

This seems to me a very obvious thing that should be supported in core!

@john-osullivan
Copy link

This would be super convenient!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet