Skip to content
Documentation
Updated 7 minutes to read
Markdown

A Policy grants access only when the user's access token holds its Claims. How several Claims, and several Policies on one Role, combine decides who gets in, and a wrong change can lock everyone out.

  • ✅ AND within a Policy: every Claim must match
  • ✅ OR between the Policies of a Role: one matching Policy is enough
  • ✅ Conflicting Claims: one Key with two values in one Policy, and the fix
  • ✅ Validation rules that stop an empty Policy

Critical Rule: All Claims within a single Policy use AND logic. Users must match ALL Claims in the Policy to satisfy it. Key and Value are trimmed and compared without regard to case (Group = contoso-finance matches Contoso-Finance).

Animation: the Policy Contoso: Finance Users gets a second Claim, Group = Contoso-Managers; the user contoso.finance, whose token lacks it, signs in and gets the Forbidden page
One extra Claim is enough: contoso.finance has no Contoso-Managers group, so the Policy no longer matches and the user gets the Forbidden page.

graph TB subgraph Role["Nodinite Role: Admin"] direction LR R["Role receives access if user matches ANY Policy"] end subgraph OR_Logic[" "] direction TB P1["Policy: AdminInDenmark"] P2["Policy: AdminInSweden"] P3["Policy: AdminInNorway"] end subgraph P1_Claims["Policy: AdminInDenmark"] direction TB C1["Group: AdminInDenmark"] end subgraph P2_Claims["Policy: AdminInSweden"] direction TB C2A["Country: Sweden"] C2B["Group: Admin"] C2A -.->|"AND"| C2B end subgraph P3_Claims["Policy: AdminInNorway"] direction TB C3A["Country: Norway"] C3B["Group: Admin"] C3A -.->|"AND"| C3B end Role -->|"OR"| P1 Role -->|"OR"| P2 Role -->|"OR"| P3 P1 --> P1_Claims P2 --> P2_Claims P3 --> P3_Claims style Role fill:#FFD525,color:#000 style P1 fill:#2678BD,color:#fff style P2 fill:#2678BD,color:#fff style P3 fill:#2678BD,color:#fff style P1_Claims fill:#3F827B,color:#fff style P2_Claims fill:#3F827B,color:#fff style P3_Claims fill:#3F827B,color:#fff style C1 fill:#93d16d,color:#000 style C2A fill:#93d16d,color:#000 style C2B fill:#93d16d,color:#000 style C3A fill:#93d16d,color:#000 style C3B fill:#93d16d,color:#000

Yellow: the Role (OR between its Policies); blue: the Policies; teal boxes: the Claims of each Policy, in green, joined by AND.

  • OR between Policies - User needs to match ANY ONE of the Policies assigned to the Role
  • AND within Policies - User must match ALL Claims within a single Policy
  • If user satisfies AdminInSweden Policy (has Country=Sweden AND Group=Admin), they get Admin role ✅
  • If user satisfies AdminInNorway Policy (has Country=Norway AND Group=Admin), they get Admin role ✅
  • If user satisfies AdminInDenmark Policy (has Group=AdminInDenmark), they get Admin role ✅
Policy: "AdminInSweden"
Claims:
* Country=Sweden (AND)
* Group=Admin (AND)

Result: Users must have BOTH Claims to match this Policy:

  • ✅ User has Country=Sweden AND Group=Admin → Access granted
  • ❌ User has only Country=Sweden → Access denied
  • ❌ User has only Group=Admin → Access denied

To achieve OR logic, create separate Policies and assign both to the same Role. You assign a Policy to a Role in the Policy's Roles card; the Role's Policies card only lists them.

Animation: the Role Contoso: Operations has one Policy; a second Policy, Contoso: Logistics Users with Group = Contoso-Logistics, is added for the same Role, and the user contoso.logistics signs in and sees the Role's Log Views
Two Policies on one Role: a user who matches either one, here contoso.logistics, gets the Role.

Policy: "AdminInDenmark"
Claims:
* AdminInDenmark=true
Policy: "AdminInSweden"
Claims:
* AdminInSweden=true
Policy: "AdminInNorway"
Claims:
* AdminInNorway=true
Role: "Nordic Administrator"
Policies:
* AdminInDenmark (OR)
* AdminInSweden (OR)
* AdminInNorway (OR)

Result: Users with ANY of these Claims get the "Nordic Administrator" role:

  • ✅ User has AdminInDenmark=true → Access granted
  • ✅ User has AdminInSweden=true → Access granted
  • ✅ User has AdminInNorway=true → Access granted
  • ✅ User has all three Claims → Access granted
Policy: "Nordic Admin" (INVALID!)
Claims:
* Country=Denmark (AND)
* Country=Sweden (AND)
* Country=Norway (AND)
  1. Policy requires ALL Claims (AND logic)
  2. A single-valued claim such as Country carries one value in the token
  3. User cannot have Country=Denmark AND Country=Sweden simultaneously
  4. ❌ No user can ever satisfy this Policy
  5. ❌ Everyone is blocked from access

A multi-valued claim is different: every value in the token counts, so a user in two groups satisfies Group=Finance AND Group=Managers. That is a valid way to require membership of both groups.

User's Claims from IDP:
AdminInDenmark: true
Group: Admin
Policy "Conflicting Example" requires:
AdminInDenmark: true (AND) ← User has this
AdminInDenmark: false (AND) ← User doesn't have this
Result: Policy NOT satisfied → Access DENIED

Correct Pattern: Separate Policies for OR Logic

Section titled “Correct Pattern: Separate Policies for OR Logic”
Policy: "DenmarkAccess"
Claims:
* Country=Denmark
Policy: "SwedenAccess"
Claims:
* Country=Sweden
Policy: "NorwayAccess"
Claims:
* Country=Norway
Role: "Nordic Administrator"
Policies:
* DenmarkAccess
* SwedenAccess
* NorwayAccess

Result: Users from any Nordic country get access:

  • ✅ User with Country=Denmark → Matches "DenmarkAccess" Policy
  • ✅ User with Country=Sweden → Matches "SwedenAccess" Policy
  • ✅ User with Country=Norway → Matches "NorwayAccess" Policy

Nodinite enforces these validation rules when managing Policies:

The Web Client keeps Save disabled and shows You must select at least one Claim and at least one Role to be able to save the Policy. until the Policy has both. New 7.12 The Web API applies the same rule: it refuses a Policy without a Claim or without a Role with HTTP 400, also when a script or an MCP tool sends it. An empty Policy grants nothing: Policies without Claims, and deleted Policies or Claims, are skipped when Nodinite works out a user's Roles.

The name must be unique, compared without regard to case and including deleted Policies; otherwise the Web API answers Policy Name '…' is already in use. Restore the deleted Policy instead of creating a new one.

There is no check for two Claims with the same Key: see The Conflicting Claims Problem for when that works and when it locks everyone out.

Policy: "Finance Manager Sweden"
Claims:
* Department=Finance ← Different key
* Country=Sweden ← Different key
* AccessLevel=Admin ← Different key
* Environment=Production ← Different key

All different keys → ✅ Valid

Policy: "Multi-Environment" (INVALID!)
Claims:
* Environment=Production (AND)
* Environment=Test (AND)

Same single-valued key with different values → ❌ No user can match

Policy: "Redundant Example"
Claims:
* Country=Sweden
* Country=Sweden ← Duplicate, but same value

Same key with same value → ✅ Valid but redundant (system may deduplicate)

...

Version:
Release date: N/A
Loading...

Explore Nodinite for 30 days – completely free

  • Find out why this is the leading O&M software
  • Prove your business case
  • Test the self-service for the business side

Loading...

See how Nodinite resolves your technical issues, in a LIVE Demo!

Once you submit this request:

  • We will give you a short call to understand the issues you want to tackle.
  • Understand solutions you have tried and why were you not happy with them.
  • Book a convenient slot for a LIVE demo!

Loading...