[GH-ISSUE #2131] (Minor) /api/EditUser fails silently with empty/misformatted body #1089

Closed
opened 2026-03-02 13:41:29 +03:00 by kerem · 2 comments
Owner

Originally created by @jonc3tech on GitHub (Feb 13, 2024).
Original GitHub issue: https://github.com/KelvinTegelaar/CIPP/issues/2131

Description

1.) Open Powershell 7
2.) Initialize API specific variables and generate token based on CIPP Documentation

$CIPPAPIUrl = "xxxx"
$ApplicationId = "xxxx"
$TenantId = "xxxx"
$apiSecret = "xxxx"

$token = Invoke-RestMethod -Uri "https://login.microsoftonline.com/$TenantId/oauth2/v2.0/token" -Method POST -Body 

3.) Submit API Post request with empty body

$AuthBody = @{
    client_id     = $ApplicationId
    client_secret = $ApplicationSecret
    scope         = "api://$($ApplicationId)/.default"
    grant_type    = 'client_credentials'
}
$AuthHeader = @{ Authorization = "Bearer $($token.access_token)" }
Invoke-RestMethod -Uri "$CIPPAPIUrl/api/EditUser" -Method POST -Headers $AuthHeader -ContentType "application/json" -Body @{}

4.) A success response is received:
image5.) CIPP Logbook notes an action with no content
image

Environment data

Sponsored instance
Front end version number: 5.1.1
Back end version number: 5.1.1
Tried Tenant Cache Clear: true
Tried Token Cache Clear: true
Originally created by @jonc3tech on GitHub (Feb 13, 2024). Original GitHub issue: https://github.com/KelvinTegelaar/CIPP/issues/2131 ### Description 1.) Open Powershell 7 2.) Initialize API specific variables and generate token based on CIPP Documentation ``` $CIPPAPIUrl = "xxxx" $ApplicationId = "xxxx" $TenantId = "xxxx" $apiSecret = "xxxx" $token = Invoke-RestMethod -Uri "https://login.microsoftonline.com/$TenantId/oauth2/v2.0/token" -Method POST -Body ``` 3.) Submit API Post request with empty body ``` $AuthBody = @{ client_id = $ApplicationId client_secret = $ApplicationSecret scope = "api://$($ApplicationId)/.default" grant_type = 'client_credentials' } $AuthHeader = @{ Authorization = "Bearer $($token.access_token)" } Invoke-RestMethod -Uri "$CIPPAPIUrl/api/EditUser" -Method POST -Headers $AuthHeader -ContentType "application/json" -Body @{} ``` 4.) A success response is received: ![image](https://github.com/KelvinTegelaar/CIPP/assets/153545031/37d258f6-5e22-4f2e-9dd2-6e1c8955e1ac)5.) CIPP Logbook notes an action with no content ![image](https://github.com/KelvinTegelaar/CIPP/assets/153545031/84b96482-106c-4ba8-8098-1a57331df125) ### Environment data ```PowerShell Sponsored instance Front end version number: 5.1.1 Back end version number: 5.1.1 Tried Tenant Cache Clear: true Tried Token Cache Clear: true ```
kerem 2026-03-02 13:41:29 +03:00
Author
Owner

@github-actions[bot] commented on GitHub (Feb 13, 2024):

Thank you for creating a bug. Please make sure your bug is indeed a unique case by checking current and past issues, and reading the complete documentation at https://docs.cipp.app/
If your bug is a known documentation issue, it will be closed without notice by a contributor. To confirm that this is not a bug found in the documentation, please copy and paste the following comment: "I confirm that I have checked the documentation thoroughly and believe this to be an actual bug."

Without confirming, your report will be closed in 24 hours. If you'd like this bug to be assigned to you, please comment "I would like to work on this please!".

<!-- gh-comment-id:1942269941 --> @github-actions[bot] commented on GitHub (Feb 13, 2024): Thank you for creating a bug. Please make sure your bug is indeed a unique case by checking current and past issues, and reading the complete documentation at https://docs.cipp.app/ If your bug is a known documentation issue, it will be closed without notice by a contributor. To confirm that this is not a bug found in the documentation, please copy and paste the following comment: "I confirm that I have checked the documentation thoroughly and believe this to be an actual bug." Without confirming, your report will be closed in 24 hours. If you'd like this bug to be assigned to you, please comment "I would like to work on this please!".
Author
Owner

@KelvinTegelaar commented on GitHub (Feb 13, 2024):

because theoritically, the user {} has been edited. ;) hahaha, fixed in dev.

<!-- gh-comment-id:1942272294 --> @KelvinTegelaar commented on GitHub (Feb 13, 2024): because theoritically, the user {} has been edited. ;) hahaha, fixed in dev.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/CIPP#1089
No description provided.