You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/active-directory/hybrid/how-to-connect-fed-group-claims.md
+48-26Lines changed: 48 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,14 +25,14 @@ Azure Active Directory can provide a users group membership information in token
25
25
> There are a number of caveats to note for this preview functionality:
26
26
>
27
27
>- Support for use of sAMAccountName and security identifier (SID) attributes synced from on-premises is designed to enable moving existing applications from AD FS and other identity providers. Groups managed in Azure AD do not contain the attributes necessary to emit these claims.
28
-
>- In larger organizations the number of groups a user is a member of may exceed the limit that Azure Active Directory will add to a token. 150 groups for a SAML token, and 200 for a JWT. This can lead to unpredictable results. If this is a potential issue we recommend testing and if necessary waiting until we add enhancements to allow you to restrict the claims to the relevant groups for the application.
28
+
>- In larger organizations the number of groups a user is a member of may exceed the limit that Azure Active Directory will add to a token. 150 groups for a SAML token, and 200 for a JWT. This can lead to unpredictable results. 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.
29
29
>- For new application development, or in cases where the application can be configured for it, and where nested group support isn't required, we recommend that in-app authorization is based on application roles rather than groups. This limits the amount of infomation that needs to go into the token, is more secure, and separates user assignment from app configuration.
30
30
31
31
## Group claims for applications migrating from AD FS and other identity providers
32
32
33
-
Many applications that are configured to authenticate with AD FS rely on group membership information in the form of Windows AD group attributes. These attributes are the group sAMAccountName, which may be qualified by-domain name, or the Windows Group Security Identifier (GroupSID). When the application is federated with AD FS, AD FS uses the TokenGroups function to retrieve the group memberships for the user.
33
+
Many applications configured to authenticate with AD FS rely on group membership information in the form of Windows AD group attributes. These attributes are the group sAMAccountName, which may be qualified by-domain name, or the Windows Group Security Identifier (GroupSID). When the application is federated with AD FS, AD FS uses the TokenGroups function to retrieve the group memberships for the user.
34
34
35
-
To match the token an app would receive from AD FS, group and role claims may be emitted containing the domain qualified sAMAccountName rather than the group's Azure Active Directory objectID.
35
+
An app that has been moved from AD FS needs claims in the same format. Group and role claims may be emitted from Azure Active Directory containing the domain qualified sAMAccountName or the GroupSID synced from Active Directory rather than the group's Azure Active Directory objectID.
36
36
37
37
The supported formats for group claims are:
38
38
@@ -47,31 +47,33 @@ The supported formats for group claims are:
47
47
48
48
## Options for applications to consume group information
49
49
50
-
One way for applications to obtain group information is to call the Graph groups endpoint in order to retrieve the group membership for the authenticated user. This call ensures that all the groups a user is a member of are available even when there are a large number of groups involved and the application needs to enumerate all groups the user is a member of. Group enumeration is then independent of token size limitations.
50
+
Applications can call the MS Graph groups endpoint to obtain group information for the authenticated user. This call ensures that all the groups a user is a member of are available even when there are a large number of groups involved. Group enumeration is then independent of token size limitations.
51
51
52
-
However, if an existing application already expects to consume group information via claims in the token it receives, Azure Active Directory can be configured with a number of different claims options to fit the needs of the application. Consider the following options:
52
+
However, if an existing application expects to consume group information via claims, Azure Active Directory can be configured with a number of different claims formats. Consider the following options:
53
53
54
-
- When using group membership for in-application authorization purposes it’s preferable to use the Group ObjectID, which is immutable and unique in Azure Active Directory and available for all groups.
55
-
- If using the on-premises group sAMAccountName for authorization, use domain qualified names; there’s less chance of situations arising were names clash. sAMAccountName on its own may be unique within an Active Directory domain, but if more than one Active Directory domain is synchronized with an Azure Active Directory tenant there is a possibility for more than one group to have the same name.
54
+
- When using group membership for in-application authorization purposes it is preferable to use the Group ObjectID. The Group ObjectID is immutable and unique in Azure Active Directory and available for all groups.
55
+
- If using the on-premises group sAMAccountName for authorization, use domain qualified names; there’s less chance of names clashing. sAMAccountName may be unique within an Active Directory domain, but if more than one Active Directory domain is synchronized with an Azure Active Directory tenant there is a possibility for more than one group to have the same name.
56
56
- Consider using [Application Roles](../../active-directory/develop/howto-add-app-roles-in-azure-ad-apps.md) to provide a layer of indirection between the group membership and the application. The application then makes internal authorization decisions based on role clams in the token.
57
-
- If the application is configured to get group attributes that are synced from Active Directory and a Group doesn't contain those attributes it won't be included in the claims.
58
-
- Group claims in tokens include nested groups. If a user is a member of GroupB and GroupB is a member of GroupA, then the group claims for the user will contain both GroupA and GroupB. For organizations with heavy usage of nested groups and users with large numbers of group memberships the number of groups listed in the token can grow the token size. Azure Active Directory limits the number of groups it will emit in a token to 150 for SAML assertions, and 200 for JWT to prevent tokens getting too large. If a user is a member of a larger number of groups than the limit, the groups are emitted along with a link to the Graph endpoint to obtain group information.
57
+
- If the application is configured to get group attributes that are synced from Active Directory and a Group doesn't contain those attributes, it won't be included in the claims.
58
+
- Group claims in tokens include nested groups except when using the option to restrict the group claims to groups assigned to the application. If a user is a member of GroupB and GroupB is a member of GroupA, then the group claims for the user will contain both GroupA and GroupB. When an organization's users have large numbers of group memberships, the number of groups listed in the token can grow the token size. Azure Active Directory limits the number of groups it will emit in a token to 150 for SAML assertions, and 200 for JWT. If a user is a member of a larger number of groups, the groups are omitted and a link to the Graph endpoint to obtain group information is included instead.
59
59
60
-
> Prerequisites for using Group attributes synchronized from Active Directory: The groups must be synchronized from Active Directory using Azure AD Connect.
60
+
## Prerequisites for using Group attributes synchronized from Active Directory
61
+
62
+
Group membership claims can be emitted in tokens for any group if you use the ObjectId format. To use group claims in formats other than the group ObjectId, the groups must be synchronized from Active Directory using Azure AD Connect.
61
63
62
64
There are two steps to configuring Azure Active Directory to emit group names for Active Directory Groups.
63
65
64
66
1.**Synchronize group names from Active Directory**
65
-
Before Azure Active Directory can emit the group names or on premises group SID in group or role claims, the required attributes need to be synchronized from Active Directory. You must be running Azure AD Connect version 1.2.70 or later. Prior to version 1.2.70 Azure AD Connect will synchronize the group objects from Active Directory, but doesn’t include the required group name attributes by default. You should upgrade to the current version.
67
+
Before Azure Active Directory can emit the group names or on premises group SID in group or role claims, the required attributes need to be synchronized from Active Directory. You must be running Azure AD Connect version 1.2.70 or later. Earlier versions of Azure AD Connect than 1.2.70 will synchronize the group objects from Active Directory, but will not include the required group name attributes. Upgrade to the current version.
66
68
67
69
2.**Configure the application registration in Azure Active Directory to include group claims in tokens**
68
-
Group claims can be configured either in the Enterprise Applications section of the portal for a Gallery or Non-Gallery SAML SSO application, or using the Application Manifest in the Application Registrations section. To configure group claims in the application manifest see “Configuring the Azure Active Directory Application Registration for group attributes” below.
70
+
Group claims can be configured in the Enterprise Applications section of the portal, or using the Application Manifest in the Application Registrations section. To configure group claims in the application manifest see “Configuring the Azure Active Directory Application Registration for group attributes” below.
69
71
70
-
## Configure group claims for SAML applications using SSO configuration
72
+
## Add group claims to tokens for SAML applications using SSO configuration
71
73
72
-
To configure Group Claims for a Gallery or Non-Gallery SAML application, open Enterprise Applications, click on the application in the list and select Single Sign On configuration.
74
+
To configure Group Claims for a Gallery or Non-Gallery SAML application, open **Enterprise Applications**, click on the application in the list, select **Single Sign On configuration**, and then select **User Attributes & Claims**.
73
75
74
-
Select the edit icon next to "Groups returned in token"
@@ -81,19 +83,29 @@ Use the radio buttons to select which groups should be included in the token
81
83
82
84
| Selection | Description |
83
85
|----------|-------------|
84
-
|**All groups**| Emits security groups and distribution lists. It also causes Directory Roles the user is assigned to be emitted in a 'wids' claim, and any application roles the user is assigned to be emitted in the roles claim.|
86
+
|**All groups**| Emits security groups and distribution listsand roles. |
85
87
|**Security groups**| Emits security groups the user is a member of in the groups claim |
86
-
|**Distribution lists**|Emits distribution lists the user is a member of|
87
-
|**Directory roles**|If the user is assigned directory roles they are emitted as a 'wids' claim (groups claim won't be emitted)|
88
+
|**Directory roles**|If the user is assigned directory roles, they are emitted as a 'wids' claim (groups claim won't be emitted)|
89
+
|**Groups assigned to the application**|Emits only the groups that are explicitly assigned to the application and the user is a member of|
88
90
89
91
For example, to emit all the Security Groups the user is a member of, select Security Groups
To emit groups using Active Directory attributes synced from Active Directory instead of Azure AD objectIDs select the required format from the drop-down. This replaces the object ID in the claims with string values containing group names. Only groups synchronized from Active Directory will be included in the claims.
95
+
To emit groups using Active Directory attributes synced from Active Directory instead of Azure AD objectIDs select the required format from the drop-down. Only groups synchronized from Active Directory will be included in the claims.
Groups assigned to the application will be included in the token. Other groups the user is a member of will be omitted. With this option nested groups are not included and the user must be a direct member of the group assigned to the application.
104
+
105
+
To change the groups assigned to the application, select the application from the **Enterprise Applications** list and then click **Users and Groups** from the application’s left-hand navigation menu.
106
+
107
+
See the document [Methods for assigning users and groups to an app](../../active-directory/manage-apps/methods-for-assigning-users-and-groups.md#assign-groups) for details of managing group assignment to applications.
108
+
97
109
### Advanced options
98
110
99
111
The way group claims are emitted can be modified by the settings under Advanced options
@@ -109,6 +121,12 @@ Some applications require the group membership information to appear in the 'rol
109
121
> [!NOTE]
110
122
> If the option to emit group data as roles is used, only groups will appear in the role claim. Any Application Roles the user is assigned will not appear in the role claim.
111
123
124
+
### Edit the group claims configuration
125
+
126
+
Once a group claim configuration has been added to the User Attributes & Claims configuration, the option to add a group claim will be greyed out. To change the group claim configuration click on the group claim in the **Additional claims** list.
## Configure the Azure AD Application Registration for group attributes
113
131
114
132
Group claims can also be configured in the [Optional Claims](../../active-directory/develop/active-directory-optional-claims.md) section of the [Application Manifest](../../active-directory/develop/reference-app-manifest.md).
@@ -117,12 +135,14 @@ Group claims can also be configured in the [Optional Claims](../../active-direct
117
135
118
136
2. Enable group membership claims by changing the groupMembershipClaim
119
137
120
-
The valid values are:
138
+
Valid values are:
121
139
122
-
- "All"
123
-
- "SecurityGroup"
124
-
- "DistributionList"
125
-
- "DirectoryRole"
140
+
| Selection | Description |
141
+
|----------|-------------|
142
+
|**"All"**| Emits security groups, distribution lists and roles |
143
+
|**"SecurityGroup"**| Emits security groups the user is a member of in the groups claim |
144
+
|**"DirectoryRole**| If the user is assigned directory roles, they are emitted as a 'wids' claim (groups claim won't be emitted) |
145
+
|**"ApplicationGroup**| Emits only the groups that are explicitly assigned to the application and the user is a member of |
126
146
127
147
For example:
128
148
@@ -134,7 +154,7 @@ Group claims can also be configured in the [Optional Claims](../../active-direct
134
154
135
155
3. Set group name configuration optional claims.
136
156
137
-
If you want the groups in the token to contain the on premises AD group attributes in the optional claims section specify which token type optional claim should be applied to, the name of optional claim requested and any additional properties desired. Multiple token types can be listed:
157
+
If you want the groups in the token to contain the on premises AD group attributes, specify which token type optional claim should be applied to in the optional claims section. Multiple token types can be listed:
138
158
139
159
- idToken for the OIDC ID token
140
160
- accessToken for the OAuth/OIDC access token
@@ -199,4 +219,6 @@ To emit group names to be returned in netbiosDomain\samAccountName format as the
199
219
200
220
## Next steps
201
221
202
-
[What is hybrid identity?](whatis-hybrid-identity.md)
222
+
[Methods for assigning users and groups to an app](../../active-directory/manage-apps/methods-for-assigning-users-and-groups.md#assign-groups)
223
+
224
+
[Configure role claims](../../active-directory/develop/active-directory-enterprise-app-role-management.md)
0 commit comments