Confirm error

First, confirm that your application does not correctly work if container restarts:

Open application, go to Login page (link on the top right corner).


Do not close the browser window!

Find running container:

docker container ls

This command will list all running containers:

CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                  NAMES
e51eec7a137e        northwind           "dotnet Northwind.We…"   13 seconds ago      Up 12 seconds>80/tcp   thirsty_germain

Find container running northwind image and stop it:

docker stop e51eec7a137e

Run container again:

docker run -p 5106:80 -e AWS_ACCESS_KEY_ID="XXX" -e AWS_SECRET_ACCESS_KEY="YYY" -e AWS_DEFAULT_REGION="eu-west-1" northwind


Enter some dummy email and password and click Log in button. Application does not work and there is following error in the logs:

info: Microsoft.AspNetCore.Mvc.ViewFeatures.Filters.AutoValidateAntiforgeryTokenAuthorizationFilter[1]
      Antiforgery token validation failed. The antiforgery token could not be decrypted.
Microsoft.AspNetCore.Antiforgery.AntiforgeryValidationException: The antiforgery token could not be decrypted.
 ---> System.Security.Cryptography.CryptographicException: The key {bf36c70e-a1f5-4e71-afbe-097f7610e00e} was not found in the key ring.