1 Database, 2 Meteor apps, Same social login tokens: Possible?


#1

I would like to set-up a multi-tenancy scenario where:

  • 2 Meteor apps are using the same database
  • Each app has its own internet domain
  • Some of the collections are used by both apps, others are separating tenant-specific data using a tenant field
  • One of the shared data collections is the user collection
  • That means: a user should be able to use the same credentials in both apps

For username / password based auth, I managed to set this up, and it works.

Now I want to add social login, e.g. via Facebook. Here is where things get tricky. Facebook lets me define only one website URL per app, so I need two different “apps” on Facebook side (because my apps use different toplevel domains). So, if the user logs in with one app, she will get a Facebook token. And once she logs in to the other app, she will get another Facebook token. But the user collection only has space for exactly one token. Is there any way to store multiple Facebook login data sets together with the same user?


#2

There’s a PR in the pipeline for re-using a FB login token, which should make this really easy:

And noted as in v.NEXT:


#3

That’s interesting, unfortunately it’s still under way and for 1.4 (I’m on 1.2).

Another option for me would be to authenticate users against one (master) app, even if they work in the other app. This should be possible according to the Accounts documentation. However, the docs in the Guide are rather sparse, and I don’t have any clue how to set this up in a way that can also work together with the useraccounts packages and mobile apps. In the useraccounts docs, I did not find any information about how to set-up a multi-server auth scenario. Seems as if this isn’t supported.