Introducing OIDC Groups Mapping β€” map multiple OIDC claims to Nextcloud groups

Hi everyone,

I’m happy to share OIDC Groups Mapping, a Nextcloud app that extends user_oidc to map multiple token claims to Nextcloud groups via configurable rules.

The problem it solves:

With user_oidc alone, you can map a single claim (mappingGroups) to groups. But many organizations need to derive groups from several claims at once β€” departments, roles, organization units, user types, etc. This app fills that gap.

Features:

  • 5 rule types β€” direct, prefix, map, conditional, template β€” covering most mapping scenarios
  • Dot-notation claim paths β€” access any nested field in the JWT token
  • Additive or replace mode β€” merge with existing groups or fully override them
  • Vue admin UI β€” visual rule editor with drag-and-drop reorder, JSON editor, and a simulator to preview results against a sample token
  • OCC commands β€” list, set, and test rules from the CLI
  • REST API β€” manage rules programmatically via OCS endpoints
  • No database β€” rules are stored in app config, zero migrations

Quick example:

Given a token like:

{
  "department": "Engineering",
  "roles": ["admin", "editor"],
  "organization": "corp.example.com",
  "userType": "INTERNAL"
}

You can configure rules to produce groups like Engineering, role_admin, role_editor, Staff, Internal-Users β€” all from a single login event.

Requirements: Nextcloud 29–32, PHP 8.1+, user_oidc app installed.

Install: Search for β€œOIDC Groups Mapping” in Administration β†’ Apps, or run:

php occ app:install oidc_groups_mapping

Feedback and contributions are welcome!

Pierre

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.