Description
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
Type
Projects
Status
Backlog