> For the complete documentation index, see [llms.txt](https://docs.onelens.cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.onelens.cloud/getting-started/single-sign-on-sso-setup/azure-entraid-saml-sso-setup.md).

# Azure EntraID SAML SSO Setup

Configure SAML single sign-on between Microsoft Entra ID (formerly Azure AD) and OneLens.

## TL;DR

* **What it does** — Lets your users sign in to OneLens with their existing Entra ID credentials, so OneLens stops being a separate username and password.
* **How long** — 20–30 minutes end to end, assuming you already have the Entra ID permissions.
* **Who does it** — Someone who can create enterprise applications in Entra ID (Application Administrator or Global Administrator) plus a OneLens `ROOT` or `ADMIN` user.
* **What you need open** — Two browser tabs: the Entra ID portal, and the OneLens SSO wizard at **Settings → SSO → Configure**.

## What You'll Get Once Connected

| Capability                    | What it means                                                                                              |
| ----------------------------- | ---------------------------------------------------------------------------------------------------------- |
| Single sign-on                | Users click through to OneLens from Entra ID or from the OneLens login page, with no separate password.    |
| Central deprovisioning        | Removing a user in Entra ID removes their access to OneLens.                                               |
| Role assignment from Entra ID | Optionally map Entra ID app roles to OneLens `ROOT`, `ADMIN` and `MEMBER` roles.                           |
| Persistent user identity      | Users are keyed on their Entra ID object ID, so a name or email change doesn't create a duplicate account. |
| MFA and conditional access    | Whatever policies you already enforce in Entra ID apply to OneLens logins too.                             |
| Auditability                  | Sign-in events appear in the Entra ID sign-in logs alongside your other apps.                              |

## Security at a Glance

| Question                         | Answer                                                                                            |
| -------------------------------- | ------------------------------------------------------------------------------------------------- |
| What protocol is used?           | SAML 2.0. OneLens also supports OIDC, configured separately.                                      |
| Where do credentials live?       | Only in Entra ID. OneLens never sees or stores the user's password.                               |
| What identifies a user?          | The Entra ID object ID (`user.objectid`), sent as a persistent Name ID.                           |
| What attributes are read?        | Name ID, `emailaddress`, `metadata`, and optionally `role`. Nothing else.                         |
| How is the assertion verified?   | Against the signing certificate in the federation metadata you upload in step 5.                  |
| Does this change existing users? | Existing OneLens users are matched on email. Set SSO as the only login method once you've tested. |
| Can it be reversed?              | Yes. Disable SSO in **Settings → SSO** and password login resumes.                                |

## How It Works

Entra ID is the identity provider (IdP) and OneLens is the service provider (SP). When a user tries to reach OneLens, OneLens redirects the browser to Entra ID; Entra ID authenticates the user and posts a signed SAML assertion back to the OneLens assertion consumer service (ACS) URL. OneLens validates the signature, reads the user's identity and role out of the assertion, and starts a session.

The setup is therefore a two-sided exchange. You give Entra ID two OneLens URLs (the entity ID and the reply URL), and you give OneLens the Entra ID federation metadata. Everything else is attribute plumbing.

{% hint style="info" %}
Both sides of the exchange are tenant-specific. The URLs and metadata shown in the OneLens wizard belong to your organization only — don't reuse values from another tenant's guide.
{% endhint %}

## Prerequisites

* An Entra ID account with permission to create and configure enterprise applications.
* A OneLens account with the `ROOT` or `ADMIN` role.
* The OneLens SAML wizard open: sign in to OneLens, go to **Settings → SSO**, and click **Configure**. This opens the wizard at `auth.onelens.cloud` with your organization's values already filled in.

{% stepper %}
{% step %}

## Create a new SAML enterprise app

In the Entra ID portal, search for **Enterprise Applications**.

<figure><img src="https://3963693991-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiyNGpqVYfmDF6qt7Lzar%2Fuploads%2FDjmHdYoF2Va1WpeTb2k1%2F0-azure-enterprise-applications.png?alt=media&amp;token=1b2621a8-83d9-45b7-9923-ed587782f328" alt=""><figcaption></figcaption></figure>

In the Enterprise Applications menu, click **New application**.

<figure><img src="https://3963693991-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiyNGpqVYfmDF6qt7Lzar%2Fuploads%2FpXfAeSbFrdhGCuRQ4JW5%2F1-new-application.png?alt=media&amp;token=5f8f1154-0628-4e39-a468-45cc4ce66b80" alt=""><figcaption></figcaption></figure>

On the next page click **Create your own application**.

<figure><img src="https://3963693991-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiyNGpqVYfmDF6qt7Lzar%2Fuploads%2FvElINj3lbvFjE9ctzVqn%2F2-create-your-own-application.png?alt=media&amp;token=fef21c6a-d180-4846-a8fd-4950979fc6af" alt=""><figcaption></figcaption></figure>

Name your app — "OneLens" is the obvious choice — and select **Integrate any other application you don't find in the gallery (Non-gallery)**. Click **Create**.

<figure><img src="https://3963693991-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiyNGpqVYfmDF6qt7Lzar%2Fuploads%2Fcjhir9U6RIwSjVY44LWl%2F3-name-your-application.png?alt=media&amp;token=054fab5d-b032-4527-b86e-37f8516af941" alt=""><figcaption></figcaption></figure>

Once the application has been created, open **Single sign-on** in the sidebar and choose **SAML**.

<figure><img src="https://3963693991-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiyNGpqVYfmDF6qt7Lzar%2Fuploads%2Fcq7WkRjF1YvDVDKAYufy%2F4-saml.png?alt=media&amp;token=b7e01801-ebd4-4a20-9a07-6935b0da2a58" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

## Enter the OneLens details into Entra ID

Edit the **Basic SAML Configuration** section and add the two service provider values from the OneLens wizard.

<figure><img src="https://3963693991-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiyNGpqVYfmDF6qt7Lzar%2Fuploads%2FXgMV3vXzrVs1B7QcyHhY%2F5-saml-configuration-azure.png?alt=media&amp;token=5cd54a32-3b32-4c6d-b959-730311dadbb2" alt=""><figcaption></figcaption></figure>

| Entra ID field                             | Value from the OneLens wizard               |
| ------------------------------------------ | ------------------------------------------- |
| Identifier (Entity ID)                     | The `.../saml/<connection-id>/metadata` URL |
| Reply URL (Assertion Consumer Service URL) | The `.../saml/<connection-id>/acs` URL      |

{% hint style="info" %}
Copy both values straight from your own wizard screen rather than typing them. The connection ID in the middle of each URL is unique to your organization, and a single wrong character produces an assertion Entra ID will refuse to send.
{% endhint %}
{% endstep %}

{% step %}

## Map user attributes

In the **Attributes & Claims** section, click the pencil icon to edit the claims Entra ID sends.

<figure><img src="https://3963693991-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiyNGpqVYfmDF6qt7Lzar%2Fuploads%2F8V6KVGfNXEB4o5Af5lre%2F5-attribute-mapping.png?alt=media&amp;token=e2307fe3-6e0d-46b0-ab53-5813829208cf" alt=""><figcaption></figcaption></figure>

Select the **Unique User Identifier (Name ID)** claim. Set **Name identifier format** to `Persistent` and **Source attribute** to `user.objectid`. Click **Save**.

<figure><img src="https://3963693991-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiyNGpqVYfmDF6qt7Lzar%2Fuploads%2F4EHB9bGOowQBVsJ58yeq%2F5-name-identifier-attribute.png?alt=media&amp;token=797d4bd5-5e73-4d20-952c-b229440afd28" alt=""><figcaption></figcaption></figure>

Some claims, such as `emailaddress`, are added for you. To add the rest, use **Add new claim** and set the **Namespace** to `http://schemas.xmlsoap.org/ws/2005/05/identity/claims`.

<figure><img src="https://3963693991-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiyNGpqVYfmDF6qt7Lzar%2Fuploads%2Fet8O8oNYW2nFUqnMvWxp%2F5-how-to-attribute-mapping.png?alt=media&amp;token=93fe5810-7bf8-44ef-8901-04cdef377cf5" alt=""><figcaption></figcaption></figure>

| Attribute     | Claim name     |
| ------------- | -------------- |
| Email         | `emailaddress` |
| Metadata      | `metadata`     |
| {% endstep %} |                |

{% step %}

## Map user roles (optional)

Without this step every user who signs in through SSO lands on the `MEMBER` role. To have Entra ID decide the role instead, send a `role` claim.

<figure><img src="https://3963693991-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiyNGpqVYfmDF6qt7Lzar%2Fuploads%2FOdu0XsVUm5uyIKVEeVmm%2F5-role-mapping.png?alt=media&amp;token=1aa4f472-afcf-476c-9948-2275f3a8c541" alt=""><figcaption></figcaption></figure>

### Add the role claim

Create a new claim with these fields:

| Field            | Value                                                   |
| ---------------- | ------------------------------------------------------- |
| Name             | `role`                                                  |
| Namespace        | `http://schemas.xmlsoap.org/ws/2005/05/identity/claims` |
| Source attribute | `user.assignedroles`                                    |

### Create the app roles

* In Entra ID, go to **App registrations** and select your app.
* Open **App roles**. You'll add three roles: `ROOT`, `ADMIN` and `MEMBER`.
* Click **Create app role**.
* Set **Display name** and **Value** to the role name exactly as written above.
* Set **Allowed member types** to **Users/groups**.
* Add a description and leave **Do you want to enable this app role?** checked.
* Click **Save**, then repeat for the remaining roles.

Once all three exist, you assign a role to a user or group at the point you add them to the application.

{% hint style="warning" %}
The role **Value** is the string OneLens matches on, and it is case-sensitive. `Admin` will not be recognised as `ADMIN`.
{% endhint %}
{% endstep %}

{% step %}

## Finish the connection in OneLens

Back in Entra ID's SAML single sign-on page, download the **Federation Metadata XML** file.

<figure><img src="https://3963693991-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiyNGpqVYfmDF6qt7Lzar%2Fuploads%2FOitiBvDCS9LIlduRDTfk%2Fmetadata.png?alt=media&amp;token=88d163d3-5ac1-4593-bb8b-da75e4bd8822" alt=""><figcaption></figcaption></figure>

Upload that file in the final step of the OneLens wizard and click **Finish**.

If you'd rather not use the metadata file, the wizard accepts the three values individually: **Login URL**, **Entra ID Identifier**, and the Base64 **Certificate**. All three are on the same Entra ID page.

<figure><img src="https://3963693991-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiyNGpqVYfmDF6qt7Lzar%2Fuploads%2F6Nwas1PPVKF7UkgkPq5u%2F6-login-and-entra-id-urls.png?alt=media&amp;token=73233056-b62d-434a-90d7-0d802c2f01a3" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

## Verify It Works

{% stepper %}
{% step %}

## Assign a test user

In Entra ID, assign at least one test user (yourself) to the application under **Users and groups**.
{% endstep %}

{% step %}

## Test sign-in

Open a private browser window and go to the OneLens login page.

Sign in with the test account and confirm you land in OneLens without being asked for a OneLens password.
{% endstep %}

{% step %}

## Confirm the assigned role

Check the user's role in **Settings → Users** matches the app role you assigned.
{% endstep %}

{% step %}

## Enable SSO-only login

Only once that passes, enable **SSO as the only login method** in **Settings → SSO**.
{% endstep %}
{% endstepper %}

{% hint style="warning" %}
Keep one OneLens `ROOT` user with password login until you have confirmed SSO works for a real user. Turning on SSO-only while the connection is misconfigured locks everyone out, including you.
{% endhint %}

## Troubleshooting

| Symptom                                           | Likely cause                                                               | Fix                                                                                                |
| ------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
| "AADSTS50011: reply URL does not match"           | The Reply URL in Entra ID doesn't exactly match the OneLens ACS URL        | Re-copy the ACS URL from the wizard; check for a trailing slash                                    |
| Signature validation fails                        | Metadata uploaded from a different app, or the certificate has rolled over | Download fresh federation metadata and re-upload it in the wizard                                  |
| A returning user shows up as a new account        | Name ID is not persistent, or is sourced from email instead of object ID   | Set Name ID format to `Persistent` and source to `user.objectid`                                   |
| Everyone lands on `MEMBER`                        | The `role` claim is missing, or the app role Value doesn't match           | Confirm the claim name, namespace and `user.assignedroles` source; check role Values are uppercase |
| "User not assigned to a role for the application" | The user isn't assigned to the enterprise app                              | Add them under **Users and groups** in Entra ID                                                    |
| Login loops back to the OneLens login page        | Assertion is valid but the email claim is missing                          | Confirm the `emailaddress` claim is present in Attributes & Claims                                 |

## FAQ

<details>

<summary>Can we use OIDC instead of SAML?</summary>

Yes. The same **Settings → SSO → Configure** flow supports OIDC; choose it at the start instead of SAML.

</details>

<details>

<summary>Do we need to re-run this when our Entra ID certificate rolls over?</summary>

Yes — upload the new federation metadata in the wizard before the old certificate expires. Entra ID emails a reminder to the notification address on the app.

</details>

<details>

<summary>What happens to users who already have OneLens passwords?</summary>

They are matched on email address and keep their existing account and data. Once you enable SSO as the only login method, their password stops working.

</details>

<details>

<summary>Can we restrict OneLens to a subset of employees?</summary>

Yes. Assign only the relevant users or groups to the enterprise application in Entra ID.

</details>

<details>

<summary>How do we disconnect SSO?</summary>

Turn off SSO in **Settings → SSO** in OneLens, then delete the enterprise application in Entra ID. Password login resumes immediately.

</details>

<details>

<summary>Does OneLens support SCIM user provisioning?</summary>

Not through this wizard. Users are created on first SSO login. Ask OneLens support if you need automated provisioning.

</details>

<details>

<summary>Can a user be `ADMIN` in one OneLens organization and `MEMBER` in another?</summary>

Roles are per-organization, and the SAML connection is per-organization, so yes — each has its own enterprise app and its own role assignment.

</details>

## Need Help?

* **Microsoft docs** — "Configure SAML-based single sign-on" and "Configure app roles" in the Entra ID documentation.
* **OneLens support** — Use **Get Help → Submit a Ticket** in the OneLens app, or reach out to your OneLens contact. Include your organization name and the connection ID from the wizard URL.

*Reference sources: OneLens Enterprise SSO setup wizard (auth.onelens.cloud), Microsoft Entra ID documentation on SAML-based single sign-on and app roles.*


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.onelens.cloud/getting-started/single-sign-on-sso-setup/azure-entraid-saml-sso-setup.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
