Microsoft Entra provisioning is sending empty request bodies to the POST /Users/ endpoint when creating user

76 Views Asked by At

I'm currently trying to implement SCIM provisioning in Microsoft Entra ID. I have set up the /Users endpoint, and Entra seems to be able to detect that and begin the provisioning process. However, it keeps failing with errors from my server. When I look into the POST requests being sent to create users, the request body is empty. So then my server fails certain validations it expects. Has anyone else run into this problem and found a solution? For context I'm running a node express server, and req.body keeps evaluating to {}. So it's not that the field doesn't exist, there's just nothing in it. Very confusing.

1

There are 1 best solutions below

0
Cameron Payton On

So, it turns out that the reason express wasn't reading it was because the default body parser only reads content type application/json, and Entra sends application/scim+json. So you need to add a body parser to your express router to handle type application/scim+json, and then it will appear in req.body. Hope this helps anyone who runs into the same issue.