BOB Docs
APITutorials

User authentication

You can always add your own auth method in AuthService and use it. Up to today, two auth suppliers are supported.

Firebase

Firebase authentication is the default option, and I highly recommend using it—especially due to its integration with Gmail, which is standard today. To use Firebase, you need to create your own Firebase project.

Creating a Firebase Project

  1. Log in to your Firebase console or create an account.
  2. Create a project—adjust the name appropriately since users logging in will see it.
  3. From the left menu, select Build → Authentication → Get Started.
  4. Set the providers you want to use in Firebase (I recommend Email and Google).
  5. Go to Settings → Authorized Domains and add your domain.
  6. Navigate to Project Settings (gear) → Service Accounts → Firebase Admin SDK.
  7. Download your Firebase private key for this project by selecting Generate New Private Key.

Do not make this key public ever!

Setting the Project

In BOB-API, the place for this certificate is: _volume/initial/user/<your_key>.json.

To enable Firebase authentication, ensure the following environment variables are set:

  • ENABLE_FIREBASE_AUTHENTICATION=1
  • FIREBASE_CERTIFICATE_PATH is set to your Firebase certificate.

To enable the frontend to use this certificate, check tutorial.

Learn more

Native Authorization

If you want to use native authorization, ensure ENABLE_SELF_AUTHENTICATION=1 is set in your environment variables.

Native authorization is not supported by default on the frontend. It is designed to be used with correlated projects or for specific extra features. If you choose to use native authorization, you must modify the frontend login and register hooks.

Redirects

After certain actions, users are redirected to specific paths in the frontend application.

To configure redirects properly, ensure the following environment variables are set to the correct paths:

  1. INVITATION_REDIRECT_LINK - Specifies the redirect link after clicking “Join organization” in an invitation.
  2. BASE_RESET_PASSWORD_URL - Specifies the redirect path for users to reset their password.

Check how to make those emails great for your clients.

Learn more

On this page