CDS pluginCDS plugintypeInstalls into a CAP project and extends the runtime. CAP loads it through cds.requires or the plugin hook.See every one →What this type is →independently maintainedindependently maintainedoriginPublished by one person or a small company outside SAP. Says nothing about quality; the readings say that.See every one →

cds-entra-id

A CAP plugin that maps Microsoft Entra ID groups and app roles onto cds.User roles, so @requires and @restrict keep working for a CAP app hosted on Azure App Services.

Lets @requires and @restrict keep working when the identity provider is Entra ID rather than XSUAA or IAS — the case for a CAP app hosted on Azure App Services.

Facts

Latestv1.0.5ReleasedLast pushLicenceApache-2.0

Where it sits

Lives in
Provides
AuthorizationCAPAuthorizationcapabilityDeciding who may read or change what, at service, entity and instance level — role checks, forwarded user context, and restrictions evaluated as query filters rather than after the fact.
Flavors
Node.jsfrom its runtime
Requires
@sap/cds^7@sap/cdsartifactThe peer range, as published.

Who is behind it

Volker BuzekVolker BuzekPersonMaintains this
In the atlas: maintains 7, contributes to 53, wrote 2
@vobu
maintainerGregor WolfPersonContributes to this
In the atlas: maintains 17, contributes to 59, wrote 2
@gregorwolf
1 contributor

Before choosing this

Signals

ActivityQuietRelease and repository quiet for 25 months

Both observable publication channels have been quiet for at least 24 full months. This may be normal for stable software; check whether its current state still fits your use.

Conditions

LicenceSAP Developer License Agreement 3.2 CAP§ 1, 2, 3A cds-plugin is used with SAP CAP materials, or an artifact is explicitly identified as a CAP plugin or application.
  • § 1 License. Productive customer applications are limited to SAP BTP or another SAP-licensed platform, and mass extraction to a non-SAP product is restricted except where solely required for SAP interoperability.
  • § 2 Intellectual Property. The agreement retains SAP's rights in the covered materials and limits making APIs, tools or software available to third parties, while preserving ownership of customer applications subject to SAP's underlying rights.
  • § 3 Artificial Intelligence Training. The agreement prohibits use of the covered materials and customer applications for training artificial-intelligence models or systems.
SAP Developer License Agreement 3.2 CAP →
PracticalFunctional boundary

It performs no authentication flow of its own. The app must already be protected by Entra ID OAuth 2.0 at the App Service level; this only maps the resulting claims. It is explicitly not intended to run locally.

What it declares

Every artifact

Type
CDS plugin
Origin
Independently maintained
Runtime
Node.js

As a CDS plugin

Declared for
^7
Distributed through
npm

Connections1

Install

npm add cds-entra-id

Derived from the package name. No recipe recorded; the README has the configuration.

README

quoted from vobu/cds-entra-id under Apache-2.0, read
vobu/cds-entra-id/README.mdOn GitHub

cds-entra-id

A SAP Cloud Application Programming Model (CAP) plugin to map Entra ID authorization to the cds.User scope.

It is intended as a drop-in authorization mapper for a CAP app running on Azure AppServices - not (!) locally. The plugin does not support any authentication flow, but the mapping of Entra ID artefacts to CAP roles for declarative authorization.

Requirements

❗ Your CAP app must be protected by OAuth 2.0 authorization with Microsoft Entra ID, configured via the App Service → Settings → Authentication

Both Entra ID Groups (https://learn.microsoft.com/en-us/entra/identity-platform/optional-claims#configure-groups-optional-claims) and App roles https://learn.microsoft.com/en-us/security/zero-trust/develop/configure-tokens-group-claims-app-roles are supported to be subsequentially used for annotation in CDS files.

Installation + Configuration

npm i --save cds-entra-id

Then tell your CAP app to use this plugin (see https://cap.cloud.sap/docs/node.js/cds-env#sources-for-cds-env for possible config file locations and configuration options).

E.g. in ./.cdsrc.json:

{
  "requires": {
    "auth": {
      "[development]": { // <-- let's keep local dev as is
        "kind": "mocked"
      },
      "[production]": { // <-- grow as you go when deployed to Azure
        "impl": "cds-entra-id"
      }
    }
  }
}

For Debugging purposes, you can set the enviornment variable DEBUG=cds-entra-id as with all CAP DEBUG options.

Usage

Annotate your .cds services as usual:

service its {
    @(requires: 'authenticated-user')
    function ok() returns String;
    @(requires: ['7b428506-466b-45b0-9cbf-4e1b20734874', 'test-app-role'])
    function nok() returns String;
}

The function import ok() requires any authenticated user, no matter the role or group.

However, nok() requires the logged in user

  • to be a member of the Entra ID group '7b428506-466b-45b0-9cbf-4e1b20734874' or
  • a member of the App role 'test-app-role'.

Why a GUID for an Entra ID group and not a regular name? Entra ID passes out group memberships only as GUIDs in order to prevent wrongful impersonation. As the note on https://learn.microsoft.com/en-us/entra/identity/hybrid/connect/how-to-connect-fed-group-claims explains:

"a group name is not unique, and display names can only be emitted for groups explicitly assigned to the application to reduce the security risks. Otherwise, any user could create a group with duplicate name and gain access in the application side."

The same website also states:

When you're using group membership for in-application authorization, it's preferable to use the group ObjectID attribute. The group ObjectID attribute is immutable and unique in Microsoft Entra ID. It's available for all groups.

And that's why cds-entra-id supports GUIDs for Entra ID group authorizations.

The App roles are app-specific (and not valid Entra ID-wide). They are relayed as regular names and can be used as such for CDS annotations.

Under the hood 🚙

The plugin parses the OAuth 2.0 claims into proper CAP User objects.

Additionally, it has no Node.js module dependencies - yay.

Contributing

💻 hack away and PR!

  • please use conventional commits so the changelog can be auto-generated. Their usage here is guarded by 🐶 husky.
  • please format the code w/ Prettier. A .prettierrc is in the repo.

License

This work is dual-licensed under Apache 2.0 and the Derived Beer-ware 🍺 License. The official license will be Apache 2.0 but finally you can choose between one of them if you use this work.

Thus, when you like this stuff, buy any (or all 😆) of the contributors a beer when you see them.

Apache-2.0, read

History

Latest

v1.0.5

  1. v1.0.4

    Fixes 1

    Notes
    Bug Fixes
    • user.roles is an object... (dffb12b)
  2. v1.0.3

    Fixes 1

    Notes
    Bug Fixes
  3. v1.0.2

    Fixes 1

    Notes
    Bug Fixes
  4. v1.0.1

    Fixes 1

    Notes
    Bug Fixes
  5. v1.0.0

3downloads per week, npm
Weekly downloads for cds-entra-id26 complete calendar weeks from 2026-04-20 to 2026-10-18; the latest total is 3.20 Apr – 26 Apr: 227 Apr – 3 May: 174 May – 10 May: 1711 May – 17 May: 2318 May – 24 May: 1025 May – 31 May: 81 Jun – 7 Jun: 158 Jun – 14 Jun: 1615 Jun – 21 Jun: 522 Jun – 28 Jun: 729 Jun – 5 Jul: 166 Jul – 12 Jul: 1913 Jul – 19 Jul: 2220 Jul – 26 Jul: 827 Jul – 2 Aug: 73 Aug – 9 Aug: 1010 Aug – 16 Aug: 817 Aug – 23 Aug: 1224 Aug – 30 Aug: 731 Aug – 6 Sept: 167 Sept – 13 Sept: 914 Sept – 20 Sept: 621 Sept – 27 Sept: 628 Sept – 4 Oct: 55 Oct – 11 Oct: 1112 Oct – 18 Oct: 3
Authorization
  1. SAP Authorization and Trust Management serviceOAuth server issuing JWTs and holding scopes for BTP apps
  2. com.sap.cds:cds-services-bomMaven bill of materials pinning CAP Java module versions
  3. cap-toolkitUtility bundle for CAP handlers: builder, roles, validation, queries
  4. @sap/ams-devCompiler from AMS DCL policies to DCN for local runs and tests
  5. @sap/amsAuthorization from DCL policies for Node.js apps on SAP Cloud Identity
  6. @sap/cdsCAP Node.js runtime

Details

Sources4
The maintainer, claiming itdiscovered herechecked
npm registry, cds-entra-idversion, releases, installschecked
github.com/vobu/cds-entra-idtree, pushes, contributors, CIchecked
README.mdquoted, and what the entry declareschecked

Sources are graph entities: the same page may back several entries, and an unreachable source flags every row that rests on it.

Compatibility and provenance
runtimesnode
declared for^7
latestv1.0.5
first release
releases and cadence5, ~0d median
discovered viaThe maintainer, claiming it
first seen in the atlas
ecosystem and domaincap, security-and-compliance
Contributors1

From the repository’s contributor list, .

History in the atlas1
  1. First seen.
For your agent
Ref
artifact:vobu-cds-entra-id
JSON
/artifacts/vobu-cds-entra-id.json
MCP
Connecting an agent