Skip to content

Instantly share code, notes, and snippets.

@terary
Created November 26, 2019 03:04
Show Gist options
  • Save terary/8a93be3086c76f3ea36d4410097861e6 to your computer and use it in GitHub Desktop.
Save terary/8a93be3086c76f3ea36d4410097861e6 to your computer and use it in GitHub Desktop.
Social authentication strategies
A) Firebase
Firstly – Firebase requires third-party cookies if self hosting. Perhaps this issue is mitigated by hosting with Firebase. The error messages do not necessarily reveal the issues are related to third party cookies. Be prepared to do some bug hunting.
I recommend anybody considering Firebase solutions review their requirements in regard to third-party cookies. Also review when exactly Firebase requires third-party cookies (self hosting, other service providers – sms, Facebook, GitHub, etc).
Secondly – There seems to be a lack of simple examples. Most examples I reviewed seem to utilize a few Firebase services coupled together. Facebook Authentication, Firebase Database, Twitter Auth, etc. The examples are nicely done but not concerned with simplicity.
With this code snippet you can do function A, or with this code snippet you can do some other function.
Instead it seem more about setting up an environment (install Firebase CLI for example), build a small application a few buttons a couple inputs and now your app; sends email, does sign-up, in, out, etc. Again making bug hunting challenging and requires a great deal of time for the minor task of reviewing the feasibility of a Firebase solution.
B) Passport
Passport is an awesome idea. The developers have done a great job over the years. However, some of the code is a little outdated and the documentation/modules are not so well maintained. Many of the strategies rely heavily on callbacks. Different strategies do not chain well together (google auth, cookie auth, twitter auth). With much effort a developer could get a working solution. But with much effort a developer could get a working solution without Passport.
I would use Passport for somethings – minor small projects with limited audience (inter-office software for an example).
Ultimately I have decided to hand-role my own.
Will post links.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment