Home > Back-end >  Which is best 0Auth based authentication library supporting multiple providers to use with react app
Which is best 0Auth based authentication library supporting multiple providers to use with react app

Time:01-02

I need an open source authentication library to use in a React JS app which supports providers like Google, Microsoft, LinkedIn, Twitter, Facebook etc.

I found this auth0/auth0-react in top results, but after digging up a bit looks like it will be only free with up to 7,000 active users.

NextAuth - this one is for next.js apps.

Please help me to find similar library for a react app.

CodePudding user response:

You might have mixed up two things:

  • Auth0 as SaaS solution for identity and access management (IAM)
  • auth0/auth0-react as a software library for using Auth0 (and other IAM solutions) in React SPAs

auth0/auth0-react is open-source under the MIT license and not restricted to a particular number of users.

Auth0 however is a commercial solution with a free plan for up to 7000 users (and with additional restrictions).

If you don't have authentication in your app yet and would like to add it now, you have two options:

  • Use an identity and access management system (IAM). Users can then either setup a new account with username/password or an account linked to a social login (Facebook, Google etc.). An IAM isn't just a software library. It a separate service you need to setup (or pay for as a SaaS solution). The well-known free option is Keycloak. In such a scenario, auth0/auth0-react is suitable to integrate the IAM into your React SPA.

  • Integrate software libraries into your React SPA without using a separate IAM. This solution will be restricted to social login only. There is no option to login without at least an account at either Facebook, Google etc. There are many libraries available that integrate a single social login but not multiple ones. A quick search revealed two npm packages promising to integrate multiple providers: reactjs-social-login and react-social-login. There are probably more out there. They are nowhere near as polished as Auth0.

  • Related