DuendeSoftware / Support

Support for Duende Software products
20 stars 0 forks source link

HexEncodingFormatSuffix -1 Why is this appended for hashing the key? #1264

Closed susan12-web closed 2 months ago

susan12-web commented 3 months ago

Which version of Duende IdentityServer are you using? 6.3.3

Which version of .NET are you using?.net 8

Describe the bug

A clear and concise description of what the bug is.

While saving the grants of access token generating grant key will be done with below lines of code : protected async Task CreateHandleAsync() { return await HandleGenerationService.GenerateAsync() + HexEncodingFormatSuffix; }

Could you please let me know why this appending + HexEncodingFormatSuffix; is needed?

Bug :

Due to this append caas harness grant store will return as meesage as below :

"Unable to fetch grants".

After removing the + HexEncodingFormatSuffix it worked.

Could you please explain the need of this ?

AndersAbel commented 3 months ago

The -1 suffix indicates that a newer storage/encoding format is used for they keys. This is an implementation detail of our store implementation.

If you do write data directly to the store without using our store service you would have to handle the updated storage format that was introduced in Duende IdentityServer v6.

josephdecock commented 3 months ago

We go into more detail about this in our docs here: https://docs.duendesoftware.com/identityserver/v7/reference/stores/persisted_grant_store/#key-property

RolandGuijt commented 2 months ago

@susan12-web Assuming Anders' and Joe's comments answer your question I'm closing this. If not feel free to reopen.