Connect Nextcloud directly to Entra ID

Plan direct Nextcloud SAML sign-in with Microsoft Entra ID, covering stable identifiers, group claims, existing accounts and offboarding acceptance checks.

Last updated

In short

  • Use Nextcloud-generated SAML metadata rather than guessed callback URLs.
  • A stable account identifier prevents duplicate users during email changes.
  • SAML authentication does not establish complete provisioning or session revocation.
On this page (6)

Integrations · Part of Nextcloud

Choose direct SAML when the relationship is simple

Direct federation lets Nextcloud trust Microsoft Entra ID for browser authentication without placing another identity broker between them. It is useful when Entra is the established organizational directory and Nextcloud is the application being introduced. A broker can still make sense for several applications or multiple upstream directories; that is a different design covered by Keycloak and Entra federation.

This guide is a documented reference procedure, not a lab-tested configuration. It uses Nextcloud’s SAML application and Microsoft’s enterprise-application SAML setup as the primary configuration references. Confirm the supported Nextcloud server/app combination and your tenant’s licensing before implementing it.

Inventory the existing accounts first

The most consequential setting is the attribute used as Nextcloud’s internal user identifier. Existing files, shares and application data refer to that account identity. Mapping a different identifier can create a new account that appears empty while the original files remain attached to the old account.

Item Record before configuration Why it matters
Nextcloud server and SAML app versions Exact release and supported pairing Configuration and behavior can differ between releases
Existing account IDs Internal ID, email and directory origin Prevent duplicate accounts and orphaned ownership
Entra tenant Tenant ID and application assignment policy Keep authentication restricted to the intended organization
Stable identifier claim Chosen immutable value and mapping Email addresses can change
Group mapping Intended group identifiers and application permissions Authentication and file access are separate decisions
Recovery administrator Local login path and controlled credential Recover from a broken federation configuration

Do not switch an established username scheme during the same maintenance window unless the account migration has been designed and rehearsed. A clean pilot with new synthetic accounts does not prove that existing production users will link correctly.

Exchange metadata rather than copying guessed addresses

Create the SAML configuration in a nonproduction Nextcloud environment with its final test hostname and valid HTTPS certificate. Obtain the service-provider metadata generated by that installation. Use its entity identifier and assertion-consumer endpoint when configuring the Entra enterprise application. Reverse proxies must produce the correct external scheme and hostname; a mismatch here can look like an identity-provider problem.

Configure Entra’s SAML sign-in endpoint and signing certificate in Nextcloud using the application’s supported settings. Restrict assignment initially to a small pilot group. Map only the necessary identity attributes, then inspect a synthetic assertion through an approved diagnostic process. Assertions contain personal data and credentials for a login exchange; keep them out of public tickets and routine application logs.

Claim purpose Design choice Acceptance evidence
Account identity Stable value matching the planned Nextcloud account ID Same account before and after email change
Display name Human-readable profile value Profile updates without identity replacement
Email Verified organizational address Correct notification recipient
Group membership Explicit mapping to intended Nextcloud groups Added and removed membership behave as expected

Microsoft’s setup guide recommends a nonproduction test environment. Use that environment to verify certificate handling, assignment and account mapping before changing the production login experience.

Keep provisioning and authentication separate

A successful SAML exchange proves that a particular authentication event was accepted. It does not prove that every account is preprovisioned, that deleted employees are removed from Nextcloud, or that active desktop clients immediately lose access. Define which system creates accounts, updates groups and disables access, and how those operations are observed.

If an existing LDAP integration owns account provisioning, decide how its identifiers align with SAML before enabling just-in-time account creation. If SAML creates accounts on first login, define how dormant accounts and file ownership are handled when a person leaves. Avoid assuming that an Entra group claim automatically grants the intended Nextcloud folder permissions; test the actual mapping.

Entra features such as Conditional Access and group-based assignment can have separate licensing requirements. Record the features actually used and confirm entitlements in the tenant. Do not infer their availability from having basic SAML sign-in working.

Run positive and negative acceptance checks

Use at least four synthetic identities: an assigned employee, an unassigned employee, a disabled account and a recovery administrator. Confirm that the assigned employee reaches the intended account and files. The unassigned and disabled identities must not create new accounts through an alternate login route. The recovery administrator must retain the explicitly approved recovery path.

Change the employee’s email and display name, then sign in again. Remove a group and check file access, search results, previews and existing shares. Disable the account while a browser session and a desktop synchronization client remain active. Measure the actual delay until each loses access, including application passwords or other tokens where applicable.

Rehearse signing-certificate rotation and an incorrect audience or callback configuration in the test environment. Expected failures should be clear to the user and diagnosable without logging full assertions.

Prepare rollback before changing production login

Save the previous configuration and a consistent Nextcloud database backup. Keep the local recovery account protected and verify its access before enabling automatic SSO redirection. If the pilot fails, restore the previous authentication configuration and reconcile any accounts created during the test; do not delete unfamiliar accounts until their file ownership has been inspected.

A production cutover is complete when identity mapping, denied access, group changes, client behavior and certificate recovery have evidence attached to the selected releases. Pilae identity services can be scoped around those acceptance requirements and the existing directory, rather than around a login screenshot alone.

Sources and further reading

Use the linked documentation to confirm the version, edition and contract that apply to your project.

Scope our Nextcloud identity

Bring your current Nextcloud account IDs, Entra tenant features and required offboarding behavior.