[BUG] OnBehalfOfCredentialOptions.SendCertificateChain value isn't sent to MSAL while getting a token #27679
Labels
Azure.Identity
Client
This issue points to a problem in the data-plane of the library.
customer-reported
Issues that are reported by GitHub users external to the Azure organization.
needs-team-attention
Workflow: This issue needs attention from Azure service team or SDK team
question
The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Library name and version
Azure.Identity 1.5.0
Describe the bug
I'm trying to request an OBO token using
Azure.Identity
. We were previously doing this using MSAL directly but now trying to move over toAzure.Identity
. Here's what I tried:When I try this I get an error back from AAD:
I enabled logging for azure-sdk-net and noticed that MSAL has SendX5C set to false even though I passed it as true into the OBOCredential object:
I tried to follow the code to see if I was missing some other property. Here's what I found so far.
_includeX5CClaimHeader
_includeX5CClaimHeader
is not used while building theIConfidentialClientApplication
in AcquireTokenOnBehalfOf(). It is being used only during AcquireTokenForClientAsync() which is used byClientCertificateCredential
andClientSecretCredential
Based on my limited knowledge, this could be fixed by passing
.WithSendX5C(_includeX5CClaimHeader)
while building the client during the OBO flow at this line but I could be wrong. Happy to send out a PR, let me know if this makes sense.Expected behavior
OnBehalfOfCredential
should leverageOnBehalfOfCredentialOptions.SendCertificateChain
and pass it into MSALActual behavior
OnBehalfOfCredential
isn't passing inOnBehalfOfCredentialOptions.SendCertificateChain
to MSAL:Reproduction Steps
Create a OBO credential object and try to request a token while using certificate:
Environment
No response
The text was updated successfully, but these errors were encountered: