Skip to content

[Feature] SSO: enforce IdP group/role claim allow-list per provider #675

Closed

Description

@pikann

Summary

Let admins configure, per OIDC provider, a trusted group/role claim and an allow-list of values. Sign-in (and account creation) is only permitted when the verified identity carries at least one allowed value.

Problem

ssodom.Provider currently supports AllowedDomains (email domain) but cannot restrict access by IdP group. Installations that must limit access to a specific Entra ID / Okta / Keycloak group have to put a separate authentication proxy in front of Paca, which adds a second session and extra sign-in interruptions.

Proposed Direction

  • Add provider fields: GroupClaim (e.g. groups, roles), AllowedGroups (list of stable values, e.g. group object IDs), and an enable flag. Default: disabled (no behavior change for existing installs).
  • Evaluate the claim from the verified ID token (and userinfo only if explicitly configured) in CompleteLogin, before linking/auto-provisioning, so it applies to both new and returning users.
  • Fail closed when the policy is enabled and the claim is absent, wrong type/malformed, empty, or incomplete.
  • Group overage (Entra _claim_names / _claim_sources): deny by default. Optionally support a secure, explicitly configured resolution (e.g. Microsoft Graph getMemberObjects with client credentials) as a follow-up; document the limitation.
  • Support string and array claims, and nested claim paths if feasible (e.g. realm_access.roles).
  • Admin UI (SsoSettings.tsx) fields + validation; API/OpenAPI + migration; i18n keys in all locales.
  • Audit/log denial reason (without leaking claim contents to the end user; show a generic "not authorized" error).

Scope

  • Product behavior, Architecture (sso service/domain/repository/migration), Admin UI, Documentation

Acceptance

  • Allowed user can sign in; user without a matching group is denied (no account created, no identity linked).
  • Missing / malformed / empty / overage claim is denied when enabled.
  • Disabled policy = identical behavior to today.
  • Unit tests in sso_service_test.go cover each case; docs cover Entra ID setup (including the overage caveat) and generic OIDC providers.

Additional Context

Raised in Discussion #673 (follow-up to #431). Group → Paca role mapping is explicitly out of scope.

Activity

  1. added
    enhancement
    good first issue
    on Oct 31, 2026
  2. pullfrog commented on Oct 31, 2026

    @pullfrog
    Contributor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementgood first issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions