How To Work Around The Azure SAML Group Claim Limitations?

Steel Contributor

We recently implemented a model in which our users can create Office 365 groups, which then can be used in all our SAML-connected third-party cloud applications to grant access to resources withing the cloud app.


The way this works is that is this:

  • The Office 365 groups are synced back to our on-premises AD.
  • The Office 365 groups must have the prefix 365sec_ in their CN and SamAccountName.
  • The cloud application must support group membership claims and the groups must be created in the app with the same name.
  • When the user authenticates, ADFS adds all groups to the token, that have the prefix "365sec_" and the user is a member of.
  • The user is now able to access all resources within the cloud app that grant him access based on group name and membership.


As an example, a SAML token for user Jon Doe would look like this:

  • Name-ID:
  • E-Mail:
  • GivenName: Jon
  • Surname: Doe
  • Groups: 365sec_Account-SeeShell
  • Groups: 365sec_Account-Wayland
  • Groups: 365sec_Project-Samson
  • Groups: 365sec_Project-VisION


We planned to move to Azure SAML, but I learned that Azure does not support adding the group CN or SamAccountName to the token, but only the objectId.


All of our cloud apps only support adding groups by Name. This seems to be the de-facto standard. It is not possible in the cloud apps to create groups with an ID and a canonical name. Consequently, the admins would need to know the objectId of the groups and the users would only be able to assign permissions on "cryptic" objectIds.


That is not user friendly and blocks us from moving our SAML authentication to Azure.


Can you recommend a way that enables to migrate to Azure while keeping group names (CN/SamAccountName) in the SAML token?

6 Replies

@LM  That's not feasible. Users are creating new groups on a weekly basis. We need something that works out of the box and is scalable.

@Daniel Niccoli 


So you are ADFS as the IDP for these clouds apps or Azure AD? Also have you investigated claims mapping.... I'm very rusty on it but I vaguely remember being able to use it to make Azure AD supply group names in the token... 


Although I suspect app roles are the longer term approach

Optional claims are only supported for groups synced from AD.

so, your options are to use groups syned from AD instaed of O365 groups or use app roles


See the link below



Optional claims are only supported for groups synced from AD.

so, your options are to use groups synced from AD instead of O365 groups or use app roles


See the link below



As Lavanya already said, names are only available for groups synced from on-premises AD. We are using Office 365 groups for permission management. We also use 365-group sync-back to have the Office 365 groups as universal security groups in our AD. Unfortunately that does not make them eligible for "groups synced from on-premises AD" for group names.

Status quo is that we are using ADFS. We add all security groups that start with "gpm__" to the SAML claim. In addition to not having names, such filtering is another thing that is not available in Azure AD.

Goal is to move to Azure AD.

The problem with roles is, that it requires static assignment on the Enterprise App level. And that is something we move away from. It makes no sense that someone manages roles who is not involved in the access management. And those people who manage access are project managers with no knowledge about Azure AD.

Besides, "These are human readable, no group IDs and token bloat" is wrong. The claim holds ids not readable names. The statement is wrong.