microsoftgraph / microsoftgraph/msgraph-sdk-powershell

-Proxy seems to be ignored on Get-MgPolicyClaimMappingPolicy

Open
#2,310 11 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Needs: Attention :wave:
Dominant language
C#
Stars
898
Forks
230
Avg merge
2d 5h
Merged PRs (30d)
31

Description

Thanks for reporting the bug. Please ensure you've gone through the following checklist before opening an issue:

Describe the bug
Have fiddler listening on 8888 locally, but -Proxy isn't doing anything different

To Reproduce
Steps to reproduce the behavior:

  1. Get-MgPolicyClaimMappingPolicy -Proxy "http://127.0.0.1:8888"
  2. Get-MgPolicyClaimMappingPolicy -Proxy "http://localhost:8888"

Expected behavior
Expect to see the http request/response in fiddler

Debug Output

C:\src> Get-MgPolicyClaimMappingPolicy  -Proxy "http://127.0.0.1:8888" -Debug
DEBUG: [CmdletBeginProcessing]: - Get-MgPolicyClaimMappingPolicy begin processing with parameterSet 'List'.
DEBUG: [Authentication]: - AuthType: 'Delegated', TokenCredentialType: 'InteractiveBrowser', ContextScope: 'CurrentUser', AppName: 'Microsoft Graph Command Line Tools'.
DEBUG: [Authentication]: - Scopes: [Application.Read.All, Directory.AccessAsUser.All, Domain.ReadWrite.All, Group.Read.All, openid, Policy.Read.All, profile, RoleManagement.Read.Directory, User.Read, User.Read.All, UserAuthenticationMethod.ReadWrite.All, email].
DEBUG: ============================ HTTP REQUEST ============================

HTTP Method:
GET

Absolute Uri:
https://graph.microsoft.com/v1.0/policies/claimsMappingPolicies

Headers:
FeatureFlag                   : 00000043
Cache-Control                 : no-store, no-cache
User-Agent                    : Mozilla/5.0,(Windows NT 10.0; Microsoft Windows 10.0.19045; en-US),PowerShell/7.3.6
Accept-Encoding               : gzip
SdkVersion                    : graph-powershell/2.3.0
client-request-id             : 3af0e37d-7af2-4370-b13f-804d6a192e71

Body:



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

Status Code:
OK

Headers:
Cache-Control                 : no-cache
Transfer-Encoding             : chunked
Vary                          : Accept-Encoding
Strict-Transport-Security     : max-age=31536000
request-id                    : 71d6d935-f50f-4a94-ae50-5d283cf2ce01
client-request-id             : 3af0e37d-7af2-4370-b13f-804d6a192e71
x-ms-ags-diagnostic           : {"ServerInfo":{"DataCenter":"West Central US","Slice":"E","Ring":"1","ScaleUnit":"001","RoleInstance":"CY4PEPF00005443"}}
x-ms-resource-unit            : 1
OData-Version                 : 4.0
Date                          : Tue, 19 Sep 2023 23:27:13 GMT

Body:
{
  "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#policies/claimsMappingPolicies",
  "value": [
    {
      "id": "6e1fa6a9-a7af-4b6c-b0f7-",
      "deletedDateTime": null,
      "definition": [
        "{\"ClaimsMappingPolicy\":{\"Version\":1,\"IncludeBasicClaimSet\":true,\"ClaimsSchema\":[{\"Source\":\"user\",\"ID\":\"JobTitle\",\"JwtClaimType\":\"JobTitle\"}]}}"
      ],
      "displayName": "Add JobTitle to claims",
      "isOrganizationDefault": false
    },
    {
      "id": "b6a570f5-c755-4b49-9c25-",
      "deletedDateTime": null,
      "definition": [
        "{\"ClaimsMappingPolicy\":{\"ClaimsSchema\":[],\"ClaimsTransformations\":[],\"GroupFilter\":{\"MatchOn\":\"samAccountName\",\"Type\":\"prefix\",\"Value\":\"App \"},\"Version\":1}}"
      ],
      "displayName": "Policy",
      "isOrganizationDefault": false
    }
  ]
}

Module Version

ModuleType Version    PreRelease Name                                ExportedCommands
---------- -------    ---------- ----                                ----------------
Script     2.3.0                 Microsoft.Graph.Authentication      {Add-MgEnvironment, Connect-MgGraph, Disconnect-MgGraph,…
Script     2.3.0                 Microsoft.Graph.Identity.SignIns    {Confirm-MgRiskyServicePrincipalCompromised, Confirm-MgR…

Environment Data

Name                           Value
----                           -----
PSVersion                      7.3.6
PSEdition                      Core
GitCommitId                    7.3.6
OS                             Microsoft Windows 10.0.19045
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Screenshots
N/A

Additional context
tried common proxy configs like $Env:HTTPS_PROXY and [System.Net.Http.HttpClient]::DefaultProxy = New-Object System.Net.WebProxy('http://localhost:8888') as well. Also tried with -ProxyUseDefaultCredentials switch

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 by reproducing the proxy behavior with Get-MgPolicyClaimMappingPolicy using the 127.0.0.1:8888 and localhost:8888 examples, with -Debug and Fiddler listening. Trace how the cmdlet handles -Proxy and -ProxyUseDefaultCredentials, then verify that the resulting HTTP request is visible through Fiddler.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.