-
Notifications
You must be signed in to change notification settings - Fork 211
Description
Describe the bug
When trying to create a claims mapping policy using New-MgPolicyClaimMappingPolicy, the command fails with:
New-MgPolicyClaimMappingPolicy : An unexpected 'StartObject' node was found for property named '' when reading from the JSON reader. A 'PrimitiveValue' node was expected.
Status: 400 (BadRequest)
ErrorCode: Request_BadRequest
Date: 2025-03-17T15:29:31
Headers:
Transfer-Encoding : chunked
Vary : Accept-Encoding
Strict-Transport-Security : max-age=31536000
request-id : 7f72f984-be50-4425-80a5-29abd9f45483
client-request-id : dfe4284f-61d0-4854-bd2e-70efa990b41e
x-ms-ags-diagnostic : {"ServerInfo":{"DataCenter":"East US 2","Slice":"E","Ring":"5","ScaleUnit":"005","RoleInstance":"BN2PEPF0000758E"}}
x-ms-resource-unit : 1
Cache-Control : no-cache
Date : Mon, 17 Mar 2025 15:29:31 GMT
At line:1 char:1
- $newPolicy = New-MgPolicyClaimMappingPolicy -BodyParameter $param
+ CategoryInfo : InvalidOperation: ({ Headers = , b...MappingPolicy }:<>f__AnonymousType0`2) [New-MgPolicyClaimMappingPolicy_Create], Exception + FullyQualifiedErrorId : Request_BadRequest,Microsoft.Graph.PowerShell.Cmdlets.NewMgPolicyClaimMappingPolicy_Create
Command used:
- https://learn.microsoft.com/en-us/powershell/module/microsoft.graph.identity.signins/new-mgpolicyclaimmappingpolicy?view=graph-powershell-1.0#example-1-code-snippet
- https://learn.microsoft.com/en-us/entra/identity-platform/claims-customization-powershell#omit-the-basic-claims-from-tokens
- https://learn.microsoft.com/en-us/graph/api/claimsmappingpolicy-post-claimsmappingpolicies?view=graph-rest-1.0&tabs=powershell#request
Expected behavior
All three examples work successfully with v2.25.0
How to reproduce
- Install Graph modules
- Verify that v2.26.0 is installed
- Use any of the examples cited above
SDK Version
2.26.1
Latest version known to work for scenario above?
2.25.0
Known Workarounds
Install prior version of module
Debug output
Click to expand log
```</details>
### Configuration
_No response_
### Other information
_No response_