Skip to content

Commit 8d710b5

Browse files
authored
Merge pull request #193985 from rwike77/groupclaimlimits
more info on group claim limits
2 parents 77ddc7e + a1a8e94 commit 8d710b5

File tree

2 files changed

+17
-11
lines changed

2 files changed

+17
-11
lines changed

articles/active-directory/develop/active-directory-optional-claims.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ ms.service: active-directory
99
ms.subservice: develop
1010
ms.topic: how-to
1111
ms.workload: identity
12-
ms.date: 12/3/2021
12+
ms.date: 04/04/2022
1313
ms.author: ryanwi
14-
ms.reviewer: paulgarn, ludwignick, keyam
14+
ms.reviewer: paulgarn, ludwignick
1515
ms.custom: aaddev
1616
---
1717

@@ -52,7 +52,7 @@ The set of optional claims available by default for applications to use are list
5252
| `ctry` | User's country/region | JWT | | Azure AD returns the `ctry` optional claim if it's present and the value of the field is a standard two-letter country/region code, such as FR, JP, SZ, and so on. |
5353
| `email` | The reported email address for this user | JWT, SAML | MSA, Azure AD | This value is included by default if the user is a guest in the tenant. For managed users (the users inside the tenant), it must be requested through this optional claim or, on v2.0 only, with the OpenID scope. This value is not guaranteed to be correct, and is mutable over time - never use it for authorization or to save data for a user. For more information, see [Validate the user has permission to access this data](access-tokens.md#validate-the-user-has-permission-to-access-this-data). If you require an addressable email address in your app, request this data from the user directly, using this claim as a suggestion or pre-fill in your UX. |
5454
| `fwd` | IP address.| JWT | | Adds the original IPv4 address of the requesting client (when inside a VNET) |
55-
| `groups`| Optional formatting for group claims |JWT, SAML| |Used with the GroupMembershipClaims setting in the [application manifest](reference-app-manifest.md), which must be set as well. For details see [Group claims](#configuring-groups-optional-claims) below. For more information about group claims, see [How to configure group claims](../hybrid/how-to-connect-fed-group-claims.md)
55+
| `groups`| Optional formatting for group claims |JWT, SAML| |For details see [Group claims](#configuring-groups-optional-claims) below. For more information about group claims, see [How to configure group claims](../hybrid/how-to-connect-fed-group-claims.md). Used with the GroupMembershipClaims setting in the [application manifest](reference-app-manifest.md), which must be set as well.
5656
| `idtyp` | Token type | JWT access tokens | Special: only in app-only access tokens | Value is `app` when the token is an app-only token. This is the most accurate way for an API to determine if a token is an app token or an app+user token.|
5757
| `login_hint` | Login hint | JWT | MSA, Azure AD | An opaque, reliable login hint claim. This claim is the best value to use for the `login_hint` OAuth parameter in all flows to get SSO. It can be passed between applications to help them silently SSO as well - application A can sign in a user, read the `login_hint` claim, and then send the claim and the current tenant context to application B in the query string or fragment when the user clicks on a link that takes them to application B. To avoid race conditions and reliability issues, the `login_hint` claim *doesn't* include the current tenant for the user, and defaults to the user's home tenant when used. If you are operating in a guest scenario, where the user is from another tenant, then you must still provide a tenant identifier in the sign in request, and pass the same to apps you partner with. This claim is intended for use with your SDK's existing `login_hint` functionality, however that it exposed. |
5858
| `sid` | Session ID, used for per-session user sign-out. | JWT | Personal and Azure AD accounts. | |
@@ -239,7 +239,7 @@ Within the SAML tokens, these claims will be emitted with the following URI form
239239
This section covers the configuration options under optional claims for changing the group attributes used in group claims from the default group objectID to attributes synced from on-premises Windows Active Directory. You can configure groups optional claims for your application through the UI or application manifest.
240240

241241
> [!IMPORTANT]
242-
> For more details including important caveats for group claims from on-premises attributes, see [Configure group claims for applications with Azure AD](../hybrid/how-to-connect-fed-group-claims.md).
242+
> Azure AD limits the number of groups emitted in a token to 150 for SAML assertions and 200 for JWT, including nested groups. For more details on group limits and important caveats for group claims from on-premises attributes, see [Configure group claims for applications with Azure AD](../hybrid/how-to-connect-fed-group-claims.md).
243243

244244
**Configuring groups optional claims through the UI:**
245245

@@ -250,7 +250,9 @@ This section covers the configuration options under optional claims for changing
250250
1. Select the application you want to configure optional claims for in the list.
251251
1. Under **Manage**, select **Token configuration**.
252252
1. Select **Add groups claim**.
253-
1. Select the group types to return (**Security groups**, or **Directory roles**, **All groups**, and/or **Groups assigned to the application**). The **Groups assigned to the application** option includes only groups assigned to the application. The **All Groups** option includes **SecurityGroup**, **DirectoryRole**, and **DistributionList**, but not **Groups assigned to the application**.
253+
1. Select the group types to return (**Security groups**, or **Directory roles**, **All groups**, and/or **Groups assigned to the application**):
254+
- The **Groups assigned to the application** option includes only groups assigned to the application. The **Groups assigned to the application** option is recommended for large organizations due to the group number limit in token. To change the groups assigned to the application, select the application from the **Enterprise applications** list. Select **Users and groups** and then **Add user/group**. Select the group(s) you want to add to the application from **Users and groups**.
255+
- The **All Groups** option includes **SecurityGroup**, **DirectoryRole**, and **DistributionList**, but not **Groups assigned to the application**.
254256
1. Optional: select the specific token type properties to modify the groups claim value to contain on premises group attributes or to change the claim type to a role.
255257
1. Select **Save**.
256258

articles/active-directory/hybrid/how-to-connect-fed-group-claims.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ms.subservice: hybrid
99
ms.service: active-directory
1010
ms.workload: identity
1111
ms.topic: how-to
12-
ms.date: 01/05/2022
12+
ms.date: 04/05/2022
1313
ms.author: billmath
1414
author: billmath
1515
---
@@ -21,12 +21,13 @@ Azure Active Directory (Azure AD) can provide a user's group membership informat
2121
- Groups identified by their Azure AD object identifier (OID) attribute
2222
- Groups identified by the `sAMAccountName` or `GroupSID` attribute for Active Directory-synchronized groups and users
2323

24+
> [!IMPORTANT]
25+
> The number of groups emitted in a token is limited to 150 for SAML assertions and 200 for JWT, including nested groups. In larger organizations, the number of groups where a user is a member might exceed the limit that Azure AD will add to a token. Exceeding a limit can lead to unpredictable results. For workarounds to these limits, read more in [Important caveats for this functionality](#important-caveats-for-this-functionality).
26+
2427
## Important caveats for this functionality
2528

2629
- Support for use of `sAMAccountName` and security identifier (SID) attributes synced from on-premises is designed to enable moving existing applications from Active Directory Federation Services (AD FS) and other identity providers. Groups managed in Azure AD don't contain the attributes necessary to emit these claims.
27-
- In larger organizations, the number of groups where a user is a member might exceed the limit that Azure AD will add to a token. Those limits are 150 groups for a SAML token and 200 for a JSON Web Token (JWT). Exceeding a limit can lead to unpredictable results.
28-
29-
If your users have large numbers of group memberships, we recommend using the option to restrict the groups emitted in claims to the relevant groups for the application. If assigning groups to your applications is not possible, you can configure a [group filter](#group-filtering) to reduce the number of groups emitted in the claim.
30+
- In order to avoid the number of groups limit if your users have large numbers of group memberships, you can restrict the groups emitted in claims to the relevant groups for the application. Read more about emitting groups assigned to the application for [JWT tokens](..\develop\active-directory-optional-claims.md#configuring-groups-optional-claims) and [SAML tokens](#add-group-claims-to-tokens-for-saml-applications-using-sso-configuration). If assigning groups to your applications is not possible, you can also configure a [group filter](#group-filtering) to reduce the number of groups emitted in the claim. Group filtering applies to tokens emitted for apps where group claims and filtering was configured in the **Enterprise apps** blade in the portal.
3031
- Group claims have a five-group limit if the token is issued through the implicit flow. Tokens requested via the implicit flow will have a `"hasgroups":true` claim only if the user is in more than five groups.
3132
- We recommend basing in-app authorization on application roles rather than groups when:
3233

@@ -99,7 +100,7 @@ To configure group claims for a gallery or non-gallery SAML application via sing
99100
| **All groups** | Emits security groups and distribution lists and roles. |
100101
| **Security groups** | Emits security groups that the user is a member of in the groups claim. |
101102
| **Directory roles** | If the user is assigned directory roles, they're emitted as a `wids` claim. (The group's claim won't be emitted.) |
102-
| **Groups assigned to the application** | Emits only the groups that are explicitly assigned to the application and that the user is a member of. |
103+
| **Groups assigned to the application** | Emits only the groups that are explicitly assigned to the application and that the user is a member of. Recommended for large organizations due to the group number limit in token. |
103104

104105
- For example, to emit all the security groups that the user is a member of, select **Security groups**.
105106

@@ -136,7 +137,10 @@ Some applications require the group membership information to appear in the role
136137
> If you use the option to emit group data as roles, only groups will appear in the role claim. Any application roles that the user is assigned to won't appear in the role claim.
137138
138139
#### Group filtering
139-
Group filtering allows for fine control of the list of groups that's included as part of the group claim. When a filter is configured, only groups that match the filter will be included in the group's claim that's sent to that application. The filter will be applied against all groups regardless of the group hierarchy.
140+
Group filtering allows for fine control of the list of groups that's included as part of the group claim. When a filter is configured, only groups that match the filter will be included in the group's claim that's sent to that application. The filter will be applied against all groups regardless of the group hierarchy.
141+
142+
> [!NOTE]
143+
> Group filtering applies to tokens emitted for apps where group claims and filtering was configured in the **Enterprise apps** blade in the portal.
140144
141145
You can configure filters to be applied to the group's display name or `SAMAccountName` attribute. The following filtering operations are supported:
142146

0 commit comments

Comments
 (0)