microsoftgraph / microsoftgraph/msgraph-sdk-powershell

Test-MgServicePrincipalSynchronizationJobCredential do not return bool value

Open
#2,977 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug: Documentation Service issue
Dominant language
C#
Stars
898
Forks
230
Avg merge
2d 5h
Merged PRs (30d)
31

Description

Describe the bug

I'm testing new credential validatity for ServicePrincipal sync job (Enterprise app / SCIM job).
Per documentation this cmdlet must return boolean.

But if credential is correct, the cmdlet return nothing.

API return a status 204, No Content as expected.
Surely the root cause.

If credential is wrong, cmdlet report an error.

Expected behavior

Return $True or $False without Error

How to reproduce

$params = @{
credentials = @(
@{
"key" = "BaseAddress"
"value" = "mytenantURL"
},
@{
"key" = "SecretToken"
"value" = "MySecretToken"
}
)
}

Test-MgServicePrincipalSynchronizationJobCredential -ServicePrincipalId $EnterpriseApp.Id -SynchronizationJobId $Syncjob.Id -BodyParameter $params

SDK Version

2.23.0

Latest version known to work for scenario above?

No response

Known Workarounds

No response

Debug output
Click to expand log ```

DEBUG: [CmdletBeginProcessing]: - Test-MgServicePrincipalSynchronizationJobCredential begin processing with parameterSet 'Validate'.
DEBUG: [Authentication]: - AuthType: 'ManagedIdentity', TokenCredentialType: 'ManagedIdentity', ContextScope: 'Process', AppName: 'MyIdentity'.
DEBUG: [Authentication]: - Scopes: [Application.ReadWrite.OwnedBy].
DEBUG: ============================ HTTP REQUEST ============================

HTTP Method:
POST

Absolute Uri:
https://graph.microsoft.com/v1.0/servicePrincipals/spnID/synchronization/jobs/synJobID/microsoft.graph.validateCredentials

Headers:
FeatureFlag : 00000043
Cache-Control : no-store, no-cache
User-Agent : Mozilla/5.0,(Windows NT 10.0; Microsoft Windows 10.0.19045; fr-FR),PowerShell/5.1.19041.4894
Accept-Encoding : gzip
SdkVersion : graph-powershell/2.23.0
client-request-id : 10664500-1ad6-412f-83ef-e182f355edbb

Body:
{
"credentials": [
{
"key": "BaseAddress",
"value": "mytenantURL"
},
{
"key": "SecretToken",
"value": "MySecretToken"
}
]
}

DEBUG: ============================ HTTP RESPONSE ============================

Status Code:
NoContent

Headers:
Strict-Transport-Security : max-age=31536000
request-id : 347f6935-9739-42c1-be16-64b9f897e521
client-request-id : 10664500-1ad6-412f-83ef-e182f355edbb
x-ms-ags-diagnostic : {"ServerInfo":{"DataCenter":"West Europe","Slice":"E","Ring":"5","ScaleUnit":"010","RoleInstance":"AM4PEPF000355B9"}}
Date : Mon, 30 Sep 2024 12:34:27 GMT

Body:

DEBUG: [CmdletEndProcessing]: - Test-MgServicePrincipalSynchronizationJobCredential end processing.

</details>


### Configuration

Name                           Value                                                                                                                                                                                                                                              
----                           -----                                                                                                                                                                                                                                              
PSVersion                      5.1.19041.4894                                                                                                                                                                                                                                     
PSEdition                      Desktop                                                                                                                                                                                                                                            
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                                                                                                                                                                            
BuildVersion                   10.0.19041.4894                                                                                                                                                                                                                                    
CLRVersion                     4.0.30319.42000                                                                                                                                                                                                                                    
WSManStackVersion              3.0                                                                                                                                                                                                                                                
PSRemotingProtocolVersion      2.3                                                                                                                                                                                                                                                
SerializationVersion           1.1.0.1
OS : Win10
Architecture: x64


### Other information

_No response_

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start from the Test-MgServicePrincipalSynchronizationJobCredential cmdlet entry point and trace how the 204 No Content response is handled. Compare the documented boolean output with the successful response path and verify that valid credentials return $True while invalid credentials still report an error.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
api, cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.