SenseNet / sensenet

Open Source Content Services Platform written in .NET
https://sensenet.com
GNU General Public License v2.0
174 stars 111 forks source link

Identity Server DefaultAntiforgeryTokenSerializer #2099

Open HegyiOliver opened 1 month ago

HegyiOliver commented 1 month ago

Description

A frequent error in our log entries. Maybe related to the expiry of the token. It may be enough to just change the log level.

Stackstrace

at Microsoft.AspNetCore.Antiforgery.DefaultAntiforgeryTokenSerializer.Deserialize(String serializedToken) at Microsoft.AspNetCore.Antiforgery.DefaultAntiforgery.GetCookieTokenDoesNotThrow(HttpContext httpContext) --- Inner exception stack trace --- at Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingBasedDataProtector.UnprotectCore(Byte[] protectedData, Boolean allowOperationsOnRevokedKeys, UnprotectStatus& status) at Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingBasedDataProtector.Unprotect(Byte[] protectedData) at Microsoft.AspNetCore.Antiforgery.DefaultAntiforgeryTokenSerializer.Deserialize(String serializedToken)

Reproduction

I couldn't figure out how to reproduce the error. However, I've found this issue on stackoverflow:

https://stackoverflow.com/questions/63444118/an-exception-was-thrown-while-deserializing-the-token-the-antiforgery-token-coul