Federated Authentication (ADFS)

Federated Authentication (ADFS) in Lightbits clusters allows you to use your existing identity provider (IdP) infrastructure for authentication. This capability eliminates the need to manage local users on the Lightbits system, and provides seamless integration with your IdP.

This functionality enables authorization for both users and applications/scripts. In OAuth 2.0, various grant flows are defined, allowing users or applications to obtain an authorization token (JWT).

Lightbits ADFS offers support for:

  • Device Authorization Flow: User mode - for users interacting directly with the Lightbits cluster using the Lightbits CLI utility.
  • Client Credentials Flow: App mode - for applications that interact with the Lightbits cluster using Lightbits’ REST API.

High-Level ADFS Workflow

This section details the high-level workflow for using ADFS.

Implementing this feature consists of two main steps:

  1. Initial configurations on the Lightbits cluster, supported by new dedicated Lightbits APIs:
  • Configure information describing the required ADFS server (the IdP).
  • Configure information of IdP client configurations.
  • Create mapping table entries of ActiveDirectory (AD) groups (for user mode) or client IDs (for application mode) to Lightbits’ scope and role (referred to as AuthMap).
  1. In user’s mode only:
  • Prepare a configuration file for the LBCLI utility, with Information on IdP.

Once the configurations are set, you can use a dedicated Lightbits CLI to log in using ADFS. You can also get services from the Lightbits cluster based on your predefined role.

This document describes the configuration steps, as well as the relevant APIs and lbcli support.

Configuring the Authentication Feature on the Lightbits Cluster

You can configure the authentication feature either by using the REST API or with lbcli. The following section details both options.

  • The cluster’s machines must have network connectivity to the IdP server.
  • Running these configuration commands requires an initial valid JWT with cluster/admin scope/role permissions (see the Lightbits lbcli and REST documentation for additional information).

Step 1: Create the IdP Configuration

CLI

Bash
Copy

REST

Bash
Copy

Step 2: Create the Client IDs' Configurations

CLI

Bash
Copy

REST

Bash
Copy

Step 3: Create AD Access Groups Mapping to the Lightbits Role/Scope

Map the AD groups or client IDs to the required Lightbits cluster roles and scopes. Repeat this step for each AD group or client ID that should be mapped to a Lightbits scope and role.

CLI

Bash
Copy

REST

Bash
Copy

At this point, you will need to enable the feature (see step 4 below). Once the feature is enabled, you will be able to use the REST API to run almost any Lightbits command from any client machine. Using CLI requires additional configuration on a client machine. This is detailed in the next section.

Step 4: Enable the Feature

By default, the ADFS functionality is disabled. Run the following command to enable this functionality:

CLI

Bash
Copy

REST

Bash
Copy

To disable this functionality, the following command should be run:

CLI

Bash
Copy

REST

Bash
Copy

Once enabled, any valid Lightbits-issued JWTs will still remain active and can be used for accessing the Lightbits services. For additional information, refer to Operational Best Practices and Maintenance.

Configuring the Authentication for User Mode (lbcli)

This section is relevant to a client application that is set to run for user’s authorization mode (authz-mode=user). This requires two additional steps:

  • Creating a configuration file on the client machine from which the user will run CLI commands.
  • Logging in.

Creating a Configuration File

Any machine that runs the Lightbits lbcli utility can be configured to interact with the Lightbits cluster using ADFS authentication. This machine must have network connectivity to the IdP server, and the following steps should be followed to prepare a local configuration file.

Manually create a file under <USER_HOME_DIR>/.lightbits/.

File name: idp-config.yaml File permissions: -rw-rw-r-- (0664) File contents:

  1. client_id - The client ID of the user’s application in ADFS.
  2. issuer - The IdP issuer URL.
  3. idp_type - The IdP type (currently “ADFS”).
  4. scope - An ADFS scope string that could be required by the IdP to be added to authorization requests. This is optional and should be set if required by the IdP for interaction.

idp-config.yaml file example:

Bash
Copy

At this point, you should be able to run “_lbcli login_” to authenticate yourself with your credentials and interact with the Lightbits cluster.

Authenticating Using the Authentication Feature on a Client Machine (lbcli)

The login command will trigger a handshake with the IdP server that will end up with storing local session/authentication information per user, allowing them to access the Lightbits cluster.

To log in, issue the lbcli login command.

  • You will receive a prompt with an IdP URL to log into, with the relevant device code (provided by the ADFS server).
  • You will then need to either click or copy the provided IdP URL to a browser, and log in using your credentials provided by the AD admin.
  • The lbcli utility will wait for the authentication to take place, and upon successful authentication, fetch the required authorization token and save it locally under the <USER_HOME_DIR>/.lightbits/ directory in a dedicated file called idp-session.yaml. This file will be created with limited permissions: -rw------- (0600).

Once logged in, any command executed using the lbcli tool will be executed with the token found in the idp-session.yaml file. This file takes precedence over any other JWTs set in the environment.

The authorization token has an expiration time set by the IdP admin. Once the token has expired, you will need to go through the login procedure described above again.

To end the session and clear data, you can optionally log out by issuing the lbcli logout command.

Issuing this command will delete the idp-session.yaml file, which holds the authorization token saved during the login flow described above. After running this command, you will be required to log in again to issue the lbcli commands.

lbcli logout is local only. It is not a Single Logout (SLO) operation, and will not invalidate the session within the IdP.

Configuring the Authentication on a Client Machine (REST API)

When using the REST API, the provisioning of authorization tokens should be managed by the client application. The client-side application is responsible for handling the lifecycle of these tokens.

Client applications should negotiate reception of the token directly with the IdP server, using a grant method such as Client Credentials (either with a client secret or x509 certificate - see the definition in OAuth 2.0 RFC 6749, section 4.4). It can then be passed to the Lightbits cluster via the REST commands as the bearer token.

Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard