Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ def _create_client_application(
cert = load_pem_x509_certificate(
data=bytes(public_certificate, "UTF-8"), backend=default_backend()
)
thumbprint = cert.fingerprint(hashes.SHA1()).hex()
thumbprint = cert.fingerprint(hashes.SHA256()).hex()
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Switching the certificate thumbprint hash from SHA-1 to SHA-256 changes both the value and length (40 hex chars -> 64). Since this value is passed to MSAL as the client_credential['thumbprint'], please verify MSAL/AAD expects a SHA-256 thumbprint here; if MSAL is still using the x5t (SHA-1) header/claim, this will break certificate-based authentication. If SHA-256 is the goal, consider using the MSAL-supported field/claim for SHA-256 (e.g., x5t#S256 / a dedicated thumbprint_sha256 parameter) or providing both where supported.

Copilot uses AI. Check for mistakes.

self._client_credential_cache = {
"thumbprint": thumbprint,
Expand Down
Loading