How to use SHA256 instead of SHA1 for Azure App Registration Thumbprint?
When using a X.509 Certificate for authenticate an Azure App Registration, SHA1 thumbprint needs to be used. But in the documentation on how to generate the assertion it says x5t header needs to use SHA256:
https://learn.microsoft.com/en-us/entra/identity-platform/certificate-credentials#assertion-format
So when using a Base64 encoded SHA256 thumbprint authentication is not working an throws following error:
AADSTS700027: The certificate with identifier used to sign the client assertion is not registered on application. [Reason - The key was not found.
When using SHA1 thumbprint it works.
I also noticed the documentation for x5t header was adjusted a few month ago where SHA1 was changed to SHA256:
https://github.com/MicrosoftDocs/entra-docs/commit/f46b30295d2ec10db0f9462349812de366b3ab18
I think it should be clearly mentioned in the documentation that for some assertions SHA1 still needs to be used!