<p>I using a kubernetes StatefulSet for a hangfire pod in gke kubernetes. It is working perfectly except when I make a replication. I get this exception due the Antiforgery token validation:</p>

<blockquote>
  <p>Microsoft.AspNetCore.Antiforgery.Internal.DefaultAntiforgery[7]
        An exception was thrown while deserializing the token.
      Microsoft.AspNetCore.Antiforgery.AntiforgeryValidationException: The antiforgery token could 
      not be decrypted. ---> System.Security.Cryptography.CryptographicException: The key 
      {9f4f1619-10ff-4283-a529-eb48a0799815} was not found in the key ring.</p>
</blockquote>

<p>Is there any solution please ?</p>

<p>The response is to Persist DataProtection key to redis </p>

<pre><code>var redis = ConnectionMultiplexer.Connect("localhost,password=password");

services.AddDataProtection()
        .PersistKeysToStackExchangeRedis(redis, "DataProtection-Keys");
</code></pre>
