---
updatedAt: 2026-07-16T20:37:26.000Z
---

# Join an Entra ID Directory tenant | AD Bridge

You can set up AD Bridge to authenticate to Active Directory or Microsoft Entra ID. Using both platforms is not supported at this time.

## Requirements

Required components for Entra ID authentication:

* **Azure Tenant**
* **Entra ID App Registration:** To join a tenant, an application **client ID** and **secret** are required. The application also defines the access permissions for the endpoint.
* **Linux desktop**
  * Ubuntu
  * Red Hat Enterprise Linux

## Authentication requirements

Here are a few things to understand about authentication:

* For an Entra ID user login, the user must belong to an Entra ID group. Both need to be provisioned with UID and GID.
* A user GID must match a provisioned group that they are a member of.
* UPN needs to match the Entra ID primary domain.
* The user that initiates the SSH session must be the same user that authenticates with the device code.

## Join to Entra ID

> ℹ️
>
> AD Bridge only supports being joined to Entra ID or Active Directory.

To join AD Bridge to Entra ID:

1. Create a temporary local file with the app registration secret value.
   ```
   vi endpoint.key
   ```

2. Join Azure tenant with **tenantjoin-cli** with the tenant-id and endpoint-id from the Linux Endpoint App.
   ```
   /opt/pbis/bin/tenantjoin-cli join --tenant-id ########-####-####-####-############ --endpoint-id ########-####-####-####-############ --endpoint-keyfile endpoint.key
   ```

3. On successful join **endpoint.key** will be removed automatically.

4. **pbis status** displays the tenant, and the provider that the agent is joined to.

   ```
   pbis status
   ```

5. **tenantjoin-cli query** displays the secret in use and it's expiration.

   ```
   /opt/pbis/bin/tenantjoin-cli query
   ```

6. Log in to the endpoint with the Entra ID user. This displays a device code and a URL.

7. In a browser, navigate to the URL and follow the prompts. You must enter the device code.

   ```
   ssh USER@TENANT@HOSTNAME
   ```

   The authorization polling interval is every 5 secs with 12 tries (60 seconds total).

## Query for Entra ID users or groups

Users who are joined to an Azure tenant can use the **ad-cache** command to query for Entra ID users. You can use the **--tenant** flag to display *users* or *groups* that are included with the tenant.

> ✅ **Example: Users**
>
> ```
> /opt/pbis/bin/ad-cache --enum-users --tenant
> ```
> ```
> Azure user object [1] \(cdc32650-cbe0-43d9-8cc8-b0f2875a6441)
> ============
> Enabled: yes  
> UID: 1193502009  
> UPN: [freshuzer@adbridge.dev](mailto:freshuzer@adbridge.dev)  
> Given name: <null>  
> Surname: <null>  
> Display Name: freshuzer  
> Last Password Change: 2023-06-09T12:39:12Z  
> Primary GID: 4244230445  
> Primary Group ObjectId: 04ea9c38-4913-4d02-9265-174d589daeb1  
> Shell: /bin/sh  
> Home Dir: >/home/local/adbridge.dev/freshuzer
> Total Azure users found: 1  
> Total users found across all >authentication providers: 1
> ```

> ✅ **Example: Users**
>
> ```
> /opt/pbis/bin/ad-cache --enum-groups --tenant
> ```
>
> ```
> Azure group object [1] \(04ea9c38-4913-4d02-9265-174d589daeb1)
> ============
> GID: 4244230445  
> Display Name: Pure Uzers Group  
> Description: <null>  
> Security Identifier: S-1-12-1-82484280-1291995411-1293378962-2981010776
> Total Azure groups found: 1  
> Total groups found across all authentication providers: 1
> ```

## Renew the connection to Entra ID

When the Entra ID application secret used to join Entra ID approaches its expiration date, AD Bridge automatically attempts to update the secret based on the value configured in the option **MachineSecretLifespan**. See the [configuration ](https://docs.beyondtrust.com/adb/docs/adb-config-tool#lsass-oauth-provider) for more information.