How to configure authentication with Entra ID¶
Entra ID is an Identity and Access Management offering from Microsoft. It is commonly used as a central location for managing users, groups, roles, and their privileges across many applications and deployments.
LXD supports authentication Entra ID via OpenID Connect (OIDC) (see OpenID Connect authentication). To configure authentication with Entra ID, follow the steps below.
We assumed that LXD is initialized and accessible over HTTPS on port 8443 (see How to expose LXD to the network for instructions). It is also assumed that you have access to an Entra ID tenant.
In your Entra ID tenant, go to
Identity > Applications > App registrationsin the left panel.
Entra ID App registrations¶
Click
+ New registration. Then choose a name for the application (for exampleLXD).
Entra ID set application name¶
Under
Redirect URI (optional), selectPublic client/native (mobile & desktop)and type:https://<your-LXD-hostname>/oidc/callback
Entra ID set redirection URI¶
Click
Register.In the configuration page for your new application, go to
Authenticationin theManagemenu.
Entra ID authentication¶
Scroll down to
Advanced settings. UnderAllow public client flows, toggleYesand clickSave.
Entra ID enable public client flows¶
In the configuration page for your new application, go to
API permissionsin theManagemenu.
Entra ID API permissions¶
Go to
Configured permissionsand click+ Add a permission.
Entra ID add a permission¶
Click
Microsoft Graphin the right panel.
Entra ID Graph API permissions¶
Click
Delegated permissions.
Entra ID Graph API delegated permissions¶
Select all
OpenId permissions, then clickAdd permissions.
Entra ID OpenID permissions¶
Above the
Managemenu, go toOverviewand copy theApplication (client) ID.
Entra ID copy client ID¶
Set this as the client ID in LXD:
lxc config set oidc.client.id <your-client-id>
While still in
Overview, clickEndpointsand copy the URL underOpenID Connect metadata document.
Entra ID tenant discovery URL¶
Navigate to the URL that you copied. This URL will display some output in JSON format.
Copy the URL from the
issuerfield. Then set this as theoidc.issuerin LXD:lxc config set oidc.issuer <your-issuer>
Alternatively, execute this command:
lxc config set oidc.issuer "$(curl <URL that you copied> | jq -r .issuer)"
You can now navigate to the LXD UI in your browser.
When you click Login with SSO, you will be redirected to Entra ID to authenticate.
In the terminal, add this LXD server as a remote by running:
lxc remote add <remote-name> <remote-url> --auth-type oidc
This prompts you to accept the public certificate fingerprint of the remote server, which should match the value for certificate shown in lxc info.
If you accept, the CLI then displays a unique login code and opens your browser.
In the browser, log in to your Entra ID tenant and enter the code.
Once the CLI process has completed, you can connect to the remote server.