---
title: "Understanding Claim Logic in Policies: AND, OR and Conflicting Claims"
description: "How Nodinite evaluates Claims in Policies: AND logic within a Policy, OR logic between the Policies of a Role, the conflicting Claims problem with one Key and two values, separate Policies for OR logic, and the validation rules that stop an empty Policy."
---

# <i class="fal fa-scale-balanced" aria-hidden="true"></i> Understanding Claim Logic in Policies

A [Policy][What is a Policy] grants access only when the user's access token holds its [Claims][]. How several Claims, and several Policies on one [Role][Roles], 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  

<aside aria-label="Important" class="nodinite-note nodinite-note--important">
<p class="nodinite-note__label" aria-hidden="true"><i class="far fa-fw fa-message-exclamation"></i> Important</p>
<div class="nodinite-note__content"><p><strong>CRITICAL: Modifying Policies Can Lock Out All Users (Including Admins)</strong></p><ol>
<li><strong>AND Logic:</strong> ALL Claims in a Policy must match. Adding one Claim makes access MORE restrictive</li>
<li><strong>IDP Dependency:</strong> Claims must exist in your Identity Provider (Microsoft Entra ID, Okta, etc.) with exact key/value match (<a href="https://docs.nodinite.com/install-and-update/troubleshooting/azure/entra-id-token-claims-validation/">Entra ID Token Claims Validation</a>)</li>
<li><strong>Fast Effect:</strong> A Policy, Claim, or Role change in <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> reaches signed-in users within about 15 seconds, without signing in again</li>
<li><strong>Lockout Risk:</strong> The <a href="https://docs.nodinite.com/core-services/web-api/overview/">Web API</a> refuses an edit or delete that would take the Administrators Role from the administrator making it (HTTP 409), but other administrators and users can still be locked out</li>
</ol><p><strong>Real-world disaster scenario:</strong></p><pre><code class="language-text">You have Policy "Administrators" with:
 - Group=Admin
&#10;You add "MFAVerified=true" thinking it adds security:
 - Group=Admin (AND)
 - MFAVerified=true (AND)
&#10;Problem: Your IDP doesn't send "MFAVerified" claim
Result: NO other user matches (Group=Admin AND MFAVerified=true)
Impact: every other administrator loses the Role within 15 seconds ❌
</code></pre><p><strong><i class="fal fa-clock" aria-hidden="true"></i> When changes arrive:</strong> <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> reads the Claims from each request's token and caches only the Roles, Policies, and Claims structure, for 15 seconds per user. A change in the identity provider (for example a user's group) arrives with the user's next token: at sign-in, or at the next refresh (the <a href="https://docs.nodinite.com/getting-started/overview/">Web Client</a> refreshes the access token 2 minutes before it expires; Microsoft Entra ID tokens typically live 60–90 minutes). Signing out and in again fetches a new token at once. See <a href="https://docs.nodinite.com/install-and-update/getting-started/version-7/install-nodinite-v7-openid/">Install Nodinite v7 - OpenID</a> for the token settings.</p><p><strong>Safe practices:</strong></p><ul>
<li>✅ Create NEW Policies instead of modifying existing ones</li>
<li>✅ Document all Claims your IDP provides before creating Policies</li>
<li>✅ Test with non-admin test accounts first</li>
<li>✅ Sign out and in again after an identity provider change, instead of waiting for the token to expire</li>
<li>✅ Never modify the built-in "Administrators" Policy without a tested backup plan</li>
<li>❌ Never add Claims "just to see what happens"</li>
<li>❌ Never test Policy changes using your only admin account</li>
</ul></div>
</aside>

## AND Logic Within a 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][1]  
*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.*  

<div class="mermaid">
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
</div>

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

### Key Insights

* **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 ✅

### Example: AdminInSweden

```text
Policy: "AdminInSweden"
Claims:
  * Country=Sweden (AND)
  * Group=Admin   (AND)
```

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

* ✅ [User][Users] has `Country=Sweden` AND `Group=Admin` → **Access granted**
* ❌ User has only `Country=Sweden` → **Access denied**
* ❌ User has only `Group=Admin` → **Access denied**

## OR Logic Between Policies

To achieve **OR** logic, create **separate Policies** and assign both to the same [Role][Roles]. 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][2]  
*Two Policies on one Role: a user who matches either one, here `contoso.logistics`, gets the Role.*  

### Example: Nordic Administrator

```text
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**

## The Conflicting Claims Problem

<aside aria-label="Important" class="nodinite-note nodinite-note--important">
<p class="nodinite-note__label" aria-hidden="true"><i class="far fa-fw fa-message-exclamation"></i> Important</p>
<div class="nodinite-note__content"><p><strong>Avoid several Claims with the same Key but different Values in one Policy.</strong> <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> doesn't stop you, but the Policy then requires <em>both</em> values, which a single-valued claim can never satisfy.</p></div>
</aside>

### Invalid Policy Configuration

```text
Policy: "Nordic Admin" (INVALID!)
Claims:
  * Country=Denmark (AND)
  * Country=Sweden  (AND)
  * Country=Norway  (AND)
```

### Why This Fails

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.

### Visual Representation

```text
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

### Valid Configuration

```text
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

## Validation Rules

<span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> enforces these validation rules when managing Policies:

### Empty Policy Detection

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. <sup><span class="nodinite-new-badge">New 7.12</span></sup> 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 <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> 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](#the-conflicting-claims-problem) for when that works and when it locks everyone out.

### Complex Scenarios

##### Valid: Multiple Keys, Different Values

```text
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

##### Invalid: Same Key, Different Values

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

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

##### Valid but Redundant: Same Key, Same Value

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

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

## <i class="fal fa-hand-point-right" aria-hidden="true"></i> Next Steps

* <i class="fal fa-shield-halved" aria-hidden="true"></i> [What is a Policy?][What is a Policy]  
* <i class="fal fa-pen-to-square" aria-hidden="true"></i> [Add or manage Policy][]  

## <i class="fal fa-link-horizontal" aria-hidden="true"></i> Related Topics

* <i class="fal fa-tag" aria-hidden="true"></i> [What is a Claim?][Claims]  
* <i class="fal fa-user-shield" aria-hidden="true"></i> [What is a Role?][Roles]  

[1]:https://docs.nodinite.com/media/Documentation%20Pictures/IM/WebClient/Admin/Authorization/Policies/Policies_AndLogic.gif
[2]:https://docs.nodinite.com/media/Documentation%20Pictures/IM/WebClient/Admin/Authorization/Policies/Policies_OrLogic.gif

[Add or manage Policy]:https://docs.nodinite.com/administration/access-management/policies/features/add-or-manage-policy/
[Claims]:https://docs.nodinite.com/administration/access-management/claims/features/what-is-a-claim/
[Entra ID Token Claims Validation]:https://docs.nodinite.com/install-and-update/troubleshooting/azure/entra-id-token-claims-validation/
[Install Nodinite v7 - OpenID]:https://docs.nodinite.com/install-and-update/getting-started/version-7/install-nodinite-v7-openid/
[Roles]:https://docs.nodinite.com/administration/access-management/roles/features/what-is-a-role/
[Users]:https://docs.nodinite.com/administration/access-management/users/features/what-is-a-user/
[Web API]:https://docs.nodinite.com/core-services/web-api/overview/
[Web Client]:https://docs.nodinite.com/getting-started/overview/
[What is a Policy]:https://docs.nodinite.com/administration/access-management/policies/features/what-is-a-policy/