Skip to content

IDX10720

Jean-Marc Prieur edited this page Nov 30, 2023 · 12 revisions

IDX10720

If you receive the following exception such as: "IDX10720: Unable to create KeyedHashAlgorithm for algorithm 'SHA256', the key size must be greater than: '256' bits, key has '128' bits. See https://aka.ms/IdentityModel/UnsafeRelaxHmacKeySizeValidation", this means that you intend to use a 256 bits crypto algorithm, but you have provided a key for this algorithm that is shorter than the expected length of keys. This means that you are less secure than you think!. The numbers and name of the algorithm can vary.

In Microsoft.IdentityModel 6.x we have fixed a security issue to prevent that doing that, as you are not as secured as you should be. This is conformat with the standard.

If you receive this exception you should really pass a key with the right number of bits.

If you really cannot act immediately, you can set a feature flag to bypass this security check, but should plan to fix the root cause as soon as possible. To set this feature flag:

Clone this wiki locally