-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Open
Labels
Azure.IdentityClientThis issue points to a problem in the data-plane of the library.This issue points to a problem in the data-plane of the library.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK teamWorkflow: This issue needs attention from Azure service team or SDK team
Milestone
Description
- Package Name:
azure-identity - Package Version:
- Operating System:
- Python Version:
Describe the bug
When CertificateCredential builds the client_credential dict and passes it to MSAL, it sets private_key as bytes:
azure-sdk-for-python/sdk/identity/azure-identity/azure/identity/_credentials/certificate.py
Line 169 in 07d1063
| client_credential = {"private_key": cert.pem_bytes, "thumbprint": hexlify(cert.fingerprint).decode("utf-8")} |
But in MSAL's document, private_key should be a str:
"private_key": "...-----BEGIN PRIVATE KEY-----... in PEM format",Its underlying jwt.encode also requires key as str:
It is fortunate that jwt.encode is smart enough to support key as bytes: https://github.com/jpadilla/pyjwt/blob/527fec277e8215a197f8facd3778b359043704ef/jwt/algorithms.py#L336, but this is undocumented behavior and may break unexpectedly.
Expected behavior
azure-identity should strictly follow MSAL's documentation to invoke MSAL.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Azure.IdentityClientThis issue points to a problem in the data-plane of the library.This issue points to a problem in the data-plane of the library.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK teamWorkflow: This issue needs attention from Azure service team or SDK team
Type
Projects
Status
Backlog
