> For the complete documentation index, see [llms.txt](https://docs.weka.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.weka.io/operation-guide/user-management/configure-oidc-single-sign-on.md). Agents can also search and read this documentation through its [MCP server](https://docs.weka.io/~gitbook/mcp).

# Configure OIDC single sign-on

Let tenant users sign in to the CLI and the GUI with their Microsoft Entra ID account through OpenID Connect (OIDC).

Each tenant can connect the cluster to its Microsoft Entra ID directory. Users of that tenant then sign in to the CLI and the GUI with their Entra ID account.

* Microsoft Entra ID is the supported identity provider.
* With MFA required, the default, the cluster accepts only sign-ins that Entra ID reports as multi-factor.
* An enabled connector takes over management sign-in for LDAP users of the tenant.
  * LDAP management sign-in stops for the tenant.
  * The LDAP configuration stays in place and keeps serving S3 users.
  * Local users sign in with their password as before.

This topic covers management sign-in. For S3 access with OIDC, see [Configure S3 OIDC authentication](https://docs.weka.io/additional-protocols/s3/s3-users-and-authentication/configure-s3-oidc-authentication.md).

## Before you begin

* Run the commands as a Cluster Admin or Tenant Admin of the tenant.
* In a tenant other than the root tenant, `ClusterAdmin` is not granted. Use `TenantAdmin` instead.

## Set up the application in Entra ID

1. Register an application for the cluster, and note:
   * The **issuer URL**, for example `https://login.microsoftonline.com/<directory-id>/v2.0`.
   * The **client ID**, which is the application ID.
   * A **client secret**, only if you register the application as a confidential client.
2. Register the redirect URIs for browser sign-in. The cluster redeems the authorization code, presenting the client secret when one is stored, so register the URIs under the platform that matches the client type: **Web** for a confidential client, **Mobile and desktop applications** for a public client.
   * **GUI:** `https://<address>/auth/callback` for each address users open the GUI at. These are the origins you set with `--redirect-uris`, followed by `/auth/callback`.
   * **CLI:** `http://127.0.0.1/auth/callback`. The CLI uses a different port at each sign-in, and Entra ID ignores the port of a loopback redirect URI. Add this URI in the application manifest, in `replyUrlsWithType`. The **Redirect URIs** box in the Entra admin center accepts only `https` loopback addresses.
   * Sign-in with `--use-device-code` needs no redirect URI. Instead, in the application's **Authentication** settings, set **Allow public client flows** to **Yes**.
3. With MFA required, the default, add the `amr` claim to the application's ID token. In **Manifest**, set `optionalClaims` so that its `idToken` list carries the claim:

   ```json
   "optionalClaims": {"accessToken": [], "idToken": [{"name": "amr", "source": null, "essential": false, "additionalProperties": []}], "saml2Token": []}
   ```

   The cluster reads this claim to confirm that a sign-in was multi-factor.
4. Set up how users receive their WEKA role. Use one method per connector:

   * **App roles:** Create app roles whose values are WEKA role names, and assign users or groups to them. The values are `ClusterAdmin`, `TenantAdmin`, `ReadOnly`, `Regular`, or `QuotaManager`. Matching ignores case.
   * **Group mapping:** Configure the application to include group claims in the token, then map each group to a WEKA role on the cluster. See [Map groups to roles](#map-groups-to-roles).

   With either method, if a user has several roles, the highest one applies.

## Configure the OIDC connector

**Command:** `weka user oidc set`

Creates or updates the tenant's OIDC connector. When you enable the connector, the cluster contacts the issuer to validate the configuration.

{% code overflow="wrap" %}

```bash
weka user oidc set [--issuer <url>] [--client-id <id>] [--vendor entra] [--role-claim <claim>] [--groups-claim <claim>] [--cluster-admin-group <group>] [--tenant-admin-group <group>] [--readonly-group <group>] [--regular-group <group>] [--quota-manager-group <group>] [--client-secret <secret> | --clear-client-secret] [--redirect-uris <origin>[,<origin>...] | --clear-redirect-uris] [--require-mfa[=false]] [--enabled[=false]]
```

{% endcode %}

**Parameters**

| Parameter                                                                                                                                                                   | Description                                                                                                                                                                                                  |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `issuer`                                                                                                                                                                    | Issuer URL of the Entra ID directory. Required to enable the connector.                                                                                                                                      |
| `client-id`                                                                                                                                                                 | Application (client) ID. Required to enable the connector.                                                                                                                                                   |
| `vendor`                                                                                                                                                                    | Identity provider. Possible value: `entra`.                                                                                                                                                                  |
| `role-claim`                                                                                                                                                                | Token claim that carries the WEKA role names. For Entra ID app roles, the claim is `roles`. To clear it, pass an empty value: `--role-claim ""`.                                                             |
| `groups-claim`                                                                                                                                                              | Token claim that carries the user's groups, for group mapping. Default: `groups`. To return to the default, pass an empty value.                                                                             |
| <p><code>cluster-admin-group</code><br><code>tenant-admin-group</code><br><code>readonly-group</code><br><code>regular-group</code><br><code>quota-manager-group</code></p> | Group that receives the `ClusterAdmin`, `TenantAdmin`, `ReadOnly`, `Regular`, or `QuotaManager` role. Specify the group object ID or name, as the token carries it. To clear a mapping, pass an empty value. |
| `client-secret`                                                                                                                                                             | Client secret, for a confidential client. Omit it for a public client. To be prompted, pass an empty value. The secret is never displayed again.                                                             |
| `clear-client-secret`                                                                                                                                                       | Removes a stored client secret, making the cluster a public client.                                                                                                                                          |
| `redirect-uris`                                                                                                                                                             | Origins that the browser sign-in can start from, in the format `https://<host>[:<port>]`. Up to 8 origins, comma-separated. Replaces the current list.                                                       |
| `clear-redirect-uris`                                                                                                                                                       | Removes every origin from the list, so the browser sign-in accepts any HTTPS origin.                                                                                                                         |
| `require-mfa`                                                                                                                                                               | Accepts only sign-ins that Entra ID reports as multi-factor. Default when the connector is created: `true`.                                                                                                  |
| `enabled`                                                                                                                                                                   | Enables the connector for the tenant. Default when the connector is created: `false`. To disable it, pass `--enabled=false`.                                                                                 |

**Example**

{% code overflow="wrap" %}

```bash
weka user oidc set --vendor entra --issuer https://login.microsoftonline.com/<directory-id>/v2.0 --client-id <application-id> --role-claim roles --enabled
```

{% endcode %}

### Map groups to roles

Group mapping assigns WEKA roles by the user's group membership in Entra ID, instead of by app roles.

* Each role takes one group. A user in several mapped groups receives the highest role.
* Each group flag updates only its own role. The other mappings stay in place.
* A connector uses either the role claim or group mapping. To switch to group mapping, clear the role claim and set the group mappings in the same command. To switch back, clear every group mapping and set the role claim in the same command.
* Entra ID limits the number of groups it puts in a token. For users who belong to many groups, configure group filtering for the application in Entra ID.

**Example**

{% code overflow="wrap" %}

```bash
weka user oidc set --role-claim "" --tenant-admin-group <admins-group-id> --readonly-group <viewers-group-id>
```

{% endcode %}

### Restrict sign-in origins

By default, the browser sign-in accepts any HTTPS origin, and the `OIDCRedirectOriginsUnrestricted` alert stays active while the connector is enabled. To accept only the addresses users open the GUI from, list them with `--redirect-uris`. The cluster appends `/auth/callback` to each origin.

* The CLI sign-in uses a loopback address, which is always accepted. List only the GUI addresses.
* To view the list, run `weka user oidc show`.

**Example**

{% code overflow="wrap" %}

```bash
weka user oidc set --redirect-uris https://cluster.example.com:14000
```

{% endcode %}

### View, reset, or rotate the connector

* To view the connector: `weka user oidc show`
* To remove the connector: `weka user oidc reset`
* To rotate the key that protects single sign-on sessions: `weka user oidc rotate-seal-key`. Single sign-on users of the tenant sign in again at their next session refresh.

## Sign in with OIDC

With the connector enabled, users of the tenant sign in with their Entra ID account, in the CLI or in the GUI.

### Sign in to the CLI

**Command:** `weka user login`

Run the command without a username, in an interactive terminal. The CLI opens a browser to the Entra ID sign-in page. After you sign in, the CLI saves the credentials to your profile. In a remote session, the CLI prints an `ssh` command to run on your local computer, so the sign-in completes in your local browser.

The sign-in can also complete away from the default browser:

* To sign in from another device, add `--use-device-code`. The CLI shows a URL and a code to enter on any device.
* To print the sign-in URL instead of opening a browser, add `--no-open`.

Single sign-on uses the cluster's default token lifetimes. `--access-token-timeout` and `--refresh-token-timeout` apply only to username and password sign-in.

To sign in as a local user, pass the username: `weka user login <username>`.

### Sign in to the GUI

1. On the sign-in screen, select **Sign in with SSO**.
2. Sign in with your Entra ID account. At the first sign-in, Entra ID asks for consent to share your basic profile with the cluster.

The GUI opens with the WEKA role granted by your Entra ID assignment.

<div data-with-frame="true"><figure><img src="https://2945940841-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FU9eAUfjPZz6inqBDXaG4%2Fuploads%2F7vohmgFxUPehRJJiWxxZ%2Fsign-in_with-SSO.png?alt=media&amp;token=df056e45-49cd-4d90-9ac2-46426560ad12" alt="The GUI sign-in screen with the Sign in with SSO option" width="338"><figcaption><p>Sign in with SSO</p></figcaption></figure></div>

## Control how long an OIDC session stays valid

The cluster rechecks an OIDC user with Entra ID when the session's access token is refreshed. Changes in Entra ID, such as a disabled account or a removed role, take effect at the next refresh.

The access token of an OIDC or LDAP user lasts at most the revalidation interval. Default: 5 minutes. To change it, see [Manage token expiration](https://docs.weka.io/security/manage-token-expiration.md).

An OIDC user can refresh the signed-in session but cannot create a long-lived API token with `weka user generate-token`. For automation that needs a long-lived token, use a local user.

{% hint style="info" %}
The cluster contacts Entra ID when users sign in and when a session refreshes, so the provider reachability events appear at those moments.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.weka.io/operation-guide/user-management/configure-oidc-single-sign-on.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
