Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions authd-oidc-brokers/conf/variants/msentraid/broker.conf
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,14 @@ client_id = <CLIENT_ID>
[flows]
## Control which authentication flows are offered to users.
##
## entra_auth: When true (default), users can authenticate directly with
## Microsoft Entra ID using their password or a supported passwordless method.
#entra_auth = true
Comment on lines +103 to +105

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we allow disabling the passwordless authentication here? Maybe with a allow_entra_passwordless setting?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(if we decide we want that, the implementation should be in a separate PR)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we allow disabling the passwordless authentication here? Maybe with a allow_entra_passwordless setting?

What would be the expected behavior here? to redirect to DAG or fail the authentication if the user has a passwordless MFA method and that setting is disabled?

or then the user would be required to enter a password at all times? (Not sure if this can contradict the Entra's policies/configuration, but I can try to experimenting with that)

Usually I don't like extending the config with too many flags, but I think it's something we can consider if the users requested it, I checked himmelblau conf, and they don't have an equivalent config. But let's test and validate the scenarios further before deciding. Maybe there is a valid use case for that.

Created https://warthogs.atlassian.net/browse/UDENG-10999 to track and investigate this further

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Usually I don't like extending the config with too many flags, but I think it's something we can consider if the users requested it

agreed, let's wait for users actually requesting such a feature before spending time on it

Comment thread
adombeck marked this conversation as resolved.

## device_code: When true (default), users can authenticate with the
## device code flow (scanning a QR code or visiting a URL and entering
## a code).
#device_code = true

## entra_password: When true (default), users can authenticate by entering
## their Microsoft Entra ID password directly, followed by MFA verification.
##
## Note: If both flows are disabled, no authentication will be available
## and users will not be able to log in.
#entra_password = true
1 change: 1 addition & 0 deletions docs/.custom_wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,4 @@ unmount
vendorize
webview
whitespace
passwordless
76 changes: 71 additions & 5 deletions docs/howto/configure-authd.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ Limited-Input Device Applications documentation](https://developers.google.com/i
::::{tab-item} Microsoft Entra ID
:sync: msentraid

Register a new application in the Microsoft Entra admin center. To register a
Register a new application in the Microsoft Entra admin center. To register a
new application, select the menu {menuselection}`Entra ID --> App registrations`:

![Menu showing selection of App registrations under Applications.](../assets/entraid-app-registration.png)
Expand All @@ -129,10 +129,12 @@ Ensure the API permission type is set to **Delegated** for each permission.
The {guilabel}`GroupMember.Read.All` permission needs admin consent. Click on
{guilabel}`Grant admin consent for <TENANT_NAME>` to provide this consent.

Finally, as the supported authentication mechanism is the device workflow, you
need to allow the public client workflows. In {menuselection}`Manage -->
Authentication (Preview) --> Settings`, ensure that {guilabel}`Allow public
client flows` is set to **Enabled**.
If you plan to use the [device code flow](#device-code-flow), you also need to allow public client
flows. In {menuselection}`Manage --> Authentication (Preview) --> Settings`,
ensure that {guilabel}`Allow public client flows` is set to **Enabled**. This
isn't required if only the Entra authentication flow is used, since it authenticates
through the Microsoft Broker App rather than through this application
registration.

[The Microsoft documentation](https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-register-app)
provides detailed instructions for registering an application with the Microsoft
Expand Down Expand Up @@ -503,6 +505,70 @@ The authd-oidc broker does not support device registration.
::::
:::::

(ref::config-auth-flows)=

## Configure authentication flows

:::::{tab-set}
:sync-group: broker

::::{tab-item} Google IAM
:sync: google

The Google IAM broker only supports the device code flow, where the user visits a URL
and enters a code to complete authentication.
::::

::::{tab-item} Microsoft Entra ID
:sync: msentraid

The `[flows]` section of the broker configuration file controls which
authentication flows are offered to the user at login. By default, both
Entra authentication and device code flow
(browser-based) are enabled.

```ini
[flows]
## Enable Entra authentication (default: true)
#entra_auth = true

## Enable browser-based device code flow (default: true)
#device_code = true
```

### Entra authentication flow

When `entra_auth` is enabled, the user can enter their Entra ID password
directly. After password verification, Microsoft Entra ID requires a second
factor (MFA). The broker automatically handles the MFA challenge:

- **Push notification or number matching**: The user approves a notification on
their registered authenticator app.
- **TOTP code**: The user enters a time-based one-time password from their
authenticator app.

```{admonition} FIDO2/WebAuthn security key support
:class: note
FIDO2/WebAuthn security keys are currently not supported for the Entra authentication flow.
If only FIDO methods are registered, the user is prompted to switch to the device code flow
instead.
```
Comment on lines +541 to +555

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At this point, it probably makes sense to also document the passwordless authentication here, and merge it after #1723 (which I expect to be merged soon anyway). WDYT?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's fine with me, we can do it in a separate commit in this PR. The only blocker would be waiting for https://gitlab.com/samba-team/libhimmelblau/-/merge_requests/165 to be merged


### Device code flow

When `device_code` is enabled, the user is presented with a device code and
a URL to visit in a browser to complete authentication. This is the standard
OAuth 2.0 Device Authorization Grant flow.
::::

::::{tab-item} Keycloak
:sync: keycloak

The authd-oidc broker only supports the device code flow, where the user visits a URL
and enters a code to complete authentication.
::::
:::::

## Restart the broker

When a configuration file is added you have to restart authd:
Expand Down
1 change: 1 addition & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ full transition to the cloud.

* **Setup**: [Installing authd](/howto/install-authd/) • [Configuring authd](/howto/configure-authd/) • [Changing authd versions](/howto/changing-versions/)
* **User login**: [Logging in with GDM](/howto/login-gdm/) • [Logging in with SSH](/howto/login-ssh/)
* **Authentication**: [Authentication flows](/reference/authentication-flows)
* **Groups and privileges (sudo, docker)**: [Configure user groups](ref::config-user-groups) • [Group management reference](/reference/group-management)
* **Deployment**: [Deploying with Landscape](/reference/landscape-deploy/) • [Deploying with cloud-init](/reference/cloud-init-deploy/)
* **Network file systems**: [Using with NFS](/howto/use-with-nfs/) • [Using with Samba](/howto/use-with-samba/)
Expand Down
51 changes: 51 additions & 0 deletions docs/reference/authentication-flows.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
myst:
html_meta:
"description lang=en": "Authentication flows supported by authd brokers."
---

# Authentication flows

An authentication flow is the sequence of steps a user goes through to verify
their identity at login.

## Google IAM

Google IAM supports the **device code flow**, where the user visits a URL
and enters a code to complete authentication.
Comment thread
adombeck marked this conversation as resolved.

## Microsoft Entra ID

Microsoft Entra ID supports the following authentication flows:

- **Device code flow**: The user visits a URL and enters a code to authenticate.
- **Entra authentication**: The user authenticates directly with Microsoft Entra ID,
using their password or a supported passwordless method, followed by an MFA
challenge if required. On success, authd caches the credentials locally for
subsequent logins.

Both flows are enabled by default and can be individually configured using the
`[flows]` section of the broker configuration file. See
[Configure authentication flows](ref::config-auth-flows) for details.

The **Entra authentication** flow has additional requirements for resolving group
membership, depending on whether device registration is enabled. See
[Group membership resolution with Entra authentication](reference::group-membership-resolution).

### Compatibility and requirements

The **device code flow** works with all Microsoft Entra ID account types.

The **Entra authentication** flow requires an MFA method enrolled on the account
that is supported by authd. The following account types cannot complete this
flow and fall back to the device code flow if it is enabled, or are denied
otherwise:

- Accounts without an MFA method enrolled
- Accounts whose only MFA method is a FIDO2/passkey credential
- Federated (on-premises AD FS) accounts

## Keycloak

Keycloak supports the **device code flow**, where the user visits a URL and
enters a code to complete authentication.
20 changes: 20 additions & 0 deletions docs/reference/group-management.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,23 @@ There are three types of groups:
1. **Primary group**: Created automatically based on the user name
1. **Local group**: Group local to the machine prefixed with `linux-`. For example, if the user is a member of the Azure group `linux-sudo`, they will be a member of the `sudo` group locally.
1. **Remote group**: All the other Azure groups the user is a member of.

(reference::group-membership-resolution)=
### Group membership resolution with Entra authentication

Group membership is read from the Microsoft Graph API. The access token obtained
from the **Entra authentication** flow does not carry the `GroupMember.Read.All`
scope, so the groups are resolved in one of two ways:

- **With device registration** (`register_device = true`): the device's primary
refresh token is exchanged for a Graph-scoped access token. No extra
configuration is required.
- **Without device registration** (`register_device = false`): a `client_secret`
must be configured in the `[oidc]` section. authd then uses the OIDC app's
client credentials to obtain an application-level Graph token. This requires
the app registration to hold the `GroupMember.Read.All` **Application**
permission with tenant admin consent.

If neither device registration nor a client secret is available, the
**Entra authentication** flow is disabled at startup, because group membership
could not be resolved.
Comment thread
adombeck marked this conversation as resolved.
21 changes: 16 additions & 5 deletions docs/reference/identity-providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,24 @@ authd supports identity providers through its identity brokers.
Each broker is available as a snap.
Several brokers can be installed and enabled on a system.

| Provider | Broker snap | Install as a snap | Configure | Provider docs |
| --- |---------------------------------------------------------|--------------------------------|--------------------------------------------------------------------------------------|--------------------------------------------------------------------------|
| Google IAM | [authd-google](https://snapcraft.io/authd-google) | `snap install authd-google` | <a href="../../howto/configure-authd/?broker=google">Google IAM guide</a> | [Google](https://cloud.google.com/iam/docs/overview) |
| Microsoft Entra ID | [authd-msentraid](https://snapcraft.io/authd-msentraid) | `snap install authd-msentraid` | <a href="../../howto/configure-authd/?broker=msentraid">Microsoft Entra ID guide</a> | [Microsoft](https://learn.microsoft.com/en-us/entra/fundamentals/whatis) |
| Keycloak | [authd-oidc](https://snapcraft.io/authd-oidc) | `snap install authd-oidc` | <a href="../../howto/configure-authd/?broker=keycloak">Keycloak guide</a> | [Keycloak](https://www.keycloak.org/documentation) |
| Provider | Broker snap | Install as a snap | Configure | Flows |
| --- |---------------------------------------------------------|--------------------------------|--------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------|
| Google IAM | [authd-google](https://snapcraft.io/authd-google) | `snap install authd-google` | <a href="../../howto/configure-authd/?broker=google">Google IAM guide</a> | [Device code flow](/reference/authentication-flows) |
| Microsoft Entra ID | [authd-msentraid](https://snapcraft.io/authd-msentraid) | `snap install authd-msentraid` | <a href="../../howto/configure-authd/?broker=msentraid">Microsoft Entra ID guide</a> | [Device code flow, Entra authentication](/reference/authentication-flows) |
| Keycloak | [authd-oidc](https://snapcraft.io/authd-oidc) | `snap install authd-oidc` | <a href="../../howto/configure-authd/?broker=keycloak">Keycloak guide</a> | [Device code flow](/reference/authentication-flows) |


```{note}
Support for multiple additional providers is planned for future releases of authd.
```

## Authentication flows
Comment thread
edibotopic marked this conversation as resolved.

See [Authentication flows](/reference/authentication-flows) for details on the
flows supported by each provider.

## Provider documentation

- [Google IAM](https://cloud.google.com/iam/docs/overview)
- [Microsoft Entra ID](https://learn.microsoft.com/en-us/entra/fundamentals/whatis)
- [Keycloak](https://www.keycloak.org/documentation)
1 change: 1 addition & 0 deletions docs/reference/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Multiple identity providers and brokers are supported by authd:
:titlesonly:

Identity providers that authd supports <identity-providers>
Authentication flows <authentication-flows>
```

## Troubleshooting
Expand Down
Loading