Groups and the groups claim
There are no roles. End users are gathered into groups, and a relying party that needs to know what
someone may do reads the names of their groups from the groups claim and decides for itself.
A group is a named set of one project’s end users. It grants nothing on this server; it exists to be read by
relying parties. Agents manage groups with the project_group_* tools.
A group is not a team. Teams are sets of administrators, and they own projects. The two are separate entities so that nothing a directory writes over SCIM, and nothing in a token, can reach the teams, which are what grants privilege here. A SCIM directory writes a project’s groups; it cannot touch a team.
Who keeps a group
Section titled “Who keeps a group”A group is kept either by administrators or by exactly one SCIM connection:
- An administrator-kept group is created on the project’s Groups tab or with
project_group_create, and its members are edited there. It may hold provisioned users too; the membership belongs to the group, and the directory never sees it. - A connection-owned group is created by the directory through
/Groups. Administrators can read it but not change it, and the connection may add only users it provisioned.
Names are unique within a project regardless of letter case. If a directory tries to create a group whose name an administrator-kept group already holds, the directory’s request is refused. An administrator can then hand the existing group over to the connection, once every member is someone that connection manages. The handover is never automatic: it is previewed first, and applies only when confirmed.
The groups scope and claim
Section titled “The groups scope and claim”A client asks for the groups scope, and the user’s groups arrive as the groups claim: their display
names, sorted.
{ "sub": "248289761001", "groups": ["Billing", "Engineering", "On-call"]}The scope is built in. It releases the claim whatever the claims setting
holds, and a groups value stored on an account’s own claims can never stand in for it: the claim is
always computed from membership.
Where the claim appears:
- UserInfo, always, when the access token carries the scope.
- The ID token only if scope claims go there at all. With
conformIdTokenClaimson, the default, they do not for thecodeflow, which is the only flow this server runs; turn it off and the claim is in the ID token too. - An access token for a declared resource, and its introspection response, when the authorization
granted
groups. The claim is a snapshot taken when the token was issued, as RFC 9068 describes, so a membership change shows up in the next token, not in one already issued.
Because the value is the display name, renaming a group changes what relying parties receive. The change is intended, since only the group’s owner can rename it and names are unique in the project, but a relying party that matches on a name has to learn the new one.
Above 200 groups, tokens point to UserInfo
Section titled “Above 200 groups, tokens point to UserInfo”A token cannot carry an unbounded list. For a user in more than 200 groups, which is the limit Entra ID applies to its own tokens and so the number relying parties already code against, the ID token and the access token carry an OpenID Connect distributed-claim reference instead of the list:
{ "_claim_names": { "groups": "groups" }, "_claim_sources": { "groups": { "endpoint": "https://auth.example.com/acme/userinfo" } }}The relying party fetches the list from UserInfo, which always carries all of it. The reference does not cover one case: a resource server holding an access token bound to its own audience cannot call UserInfo with it, so it cannot follow the reference. If a resource server needs the groups of people in more than 200 of them, give it another way to look them up.
Moving from roles
Section titled “Moving from roles”The 0.8.0 upgrade turned every role into an administrator-kept group with the same members, and every holder
of super_admin into a member of the Super administrators team.
Upgrading has the details. A relying party that read roles from a custom claim reads
groups now; a script that set roles through the admin API sets group memberships instead.