I have trouble posting a custom claims policy using both graph and powershell

Stefanos Christoudias 0 Reputation points
2025-04-13T19:59:36.4366667+00:00

i have the below json :

When i post it , i get

"message": "Property definition has an invalid value.",
{
  "definition": [
    "{\"ClaimsMappingPolicy\": {
        \"Version\": 1,
        \"IncludeBasicClaimSet\": true,
        \"ClaimsSchema\": [
            {
                \"Source\": \"user.groups\",
                \"ID\": \"xxx_groups_v1_azure\",
                \"SamlClaimType\": \"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/xxxGroups\",
                \"TransformationRules\": [
                    {
                        \"Type\": \"filter\",
                        \"Condition\": {
                            \"Operator\": \"startsWith\",
                            \"Value\": \"g_aad_xxx_\"
                        }
                    },
                    {
                        \"Type\": \"join\",
                        \"Delimiter\": \",\"
                    }
                ]
            },
            {
                \"Source\": \"user.groups\",
                \"ID\": \"xxx_licenses_v1_azure\",
                \"SamlClaimType\": \"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/xxxLicenses\",
                \"TransformationRules\": [
                    {
                        \"Type\": \"filter\",
                        \"Condition\": {
                            \"Operator\": \"startsWith\",
                            \"Value\": \"g_aad_xxx lic_\"
                        }
                    },
                    {
                        \"Type\": \"extract\",
                        \"Pattern\": \"(?<=lic_)(\\\\w+)\"
                    }
                ]
            }
        ]
    }}"
  ],
  "displayName": "xxx Claims Mapping Policy",
  "isOrganizationDefault": false
}

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
24,185 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.