Skip to main content

Authentication and Root User

Overview

Fireback's workspaces module includes a built-in authentication system. Whether you use this system or integrate external user management services like Salesforce or Keycloak, authentication is required for both HTTP and CLI access.

For projects or microservices where the ABAC (Attribute-Based Access Control) system is unnecessary, you can authorize the project using a root account. In this case, all operations will be performed as the root user.

Creating an Account

When initializing a new environment with fireback init or ./app init, the interactive CLI will prompt you to create a new user with a passport and assign it to the root workspace.

The root workspace is always created and cannot be removed.

To create a new account via CLI and authenticate:

fireback passport new

Alternatively, you can use:

fireback user new

This command creates a new user, assigns it to the root workspace, and authenticates the CLI with the generated workspace and token.

If you prefer a non-interactive setup, check the available options with:

fireback user new --help

Command Options:

NAME:
Fireback core microservice - v1.2.0 user new - Creates a user interactively and sets credentials in the workspace config

USAGE:
Fireback core microservice - v1.2.0 user new [command options] [arguments...]

OPTIONS:
--in-root Assign the user to the root group
--value value User value
--workspace-type-id value Workspace type ID (e.g., 'root')
--type value Authentication type ('phonenumber', 'email')
--password value Password
--first-name value First name
--last-name value Last name

Signing in with Different Accounts

To sign in to a user account, use:

fireback passport auth

Or:

fireback user auth

For non-interactive authentication, check the available options:

fireback user auth --help

Command Options:

NAME:
Fireback core microservice - v1.2.0 user auth - Signs in a user with passport and password, storing credentials in the environment for CLI usage

USAGE:
Fireback core microservice - v1.2.0 user auth [command options] [arguments...]

OPTIONS:
--value value User value
--password value Password
--wid value Workspace ID (if the user belongs to multiple workspaces). If not set, the CLI will prompt for selection.

Difference Between passport up and passport in

Fireback provides two CLI commands: passport up and passport in. These commands create an account or sign in, respectively. However, they differ from passport auth and passport new:

  • passport up and passport in are designed for public HTTP requests and include additional details.
  • These commands do not change the CLI state; they only facilitate Fireback's HTTP request handling within the CLI.