Skip to content

AllowedHttpHeaders seems not respected for WorkloadIdentityCredential #6471

Open
@hestolz

Description

@hestolz

Describe the bug
Azure::Core::Credentials::TokenCredentialOptions has Log member, who in turn has member AllowedHttpHeaders. When I append to this list and pass to the WorkloadIdentityCredential constructor, it does not take effect; the logs for HTTP calls are still redacted.

To Reproduce
Steps to reproduce the behavior:
Compiled the below code. So, user-agent, x-ms-request-id, x-ms-client-request-id should not be redacted, yet they are:

2025-03-17T15:45:10.1816810Z: [Azure SDK] HTTP Request : POST https://login.microsoftonline.com/.../oauth2/v2.0/token
...
user-agent : REDACTED
x-ms-client-request-id : REDACTED

Code Snippet
Add the code snippet that causes the issue.

Azure::Core::Http::CurlTransportOptions curlOptions;
Azure::Core::Credentials::TokenCredentialOptions credentialOptions;
...
credentialOptions.Transport.Transport = std::make_shared<Azure::Core::Http::CurlTransport>(curlOptions);
credentialOptions.Log.AllowedHttpHeaders.insert({ "user-agent", "x-ms-request-id", "x-ms-client-request-id"});

_workloadIdentityCredential = std::make_shared<Azure::Identity::WorkloadIdentityCredential>(credentialOptions);
...
Azure::Core::Context context;
Azure::Core::Credentials::TokenRequestContext tokenRequestContext;
tokenRequestContext.Scopes = { _resource };

Azure::Core::Credentials::AccessToken token = _workloadIdentityCredential->GetToken(tokenRequestContext, context);

Expected behavior
I expected to see unredacted values for configured headers like user-agent.

Setup (please complete the following information):

  • OS: Azure Linux 2
  • IDE : vscode
  • Compiler: g++
  • Version of the Library used: 1.10.1

Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

  • Bug Description Added
  • Repro Steps Added
  • Setup information Added

Metadata

Metadata

Assignees

Labels

Azure.IdentityClientThis issue points to a problem in the data-plane of the library.customer-reportedIssues that are reported by GitHub users external to the Azure organization.needs-author-feedbackWorkflow: More information is needed from author to address the issue.no-recent-activityThere has been no recent activity on this issue.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Projects

  • Status

    Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions