Skip to content

This silently fails in ASP.NET Core 2.1 #4

@gtrak

Description

@gtrak

Given this Startup.cs config:

services.AddDataProtection()
             .SetApplicationName("my-app")
             .PersistKeysToDistributedCache();

I see logs:

Using an in-memory repository. Keys will not be persisted to storage.

And sessions are still lost across restarts.

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
{66e01a09-21d3-4cd5-865f-a021dd1d23d5} was not found in the key ring.

I verified that key was created earlier with the same distributed cache config, and the cache is indeed working for other cases.

I'll probably try S3 but wanted to make this a github issue for the next person.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions