aws / aws-aspnet-cognito-identity-provider

ASP.NET Core Identity Provider for Amazon Cognito
https://aws.amazon.com/developer/language/net/
Apache License 2.0
215 stars 89 forks source link

AWS Lambda Serverless - Antiforgery token validation failed. The antiforgery token could not be decrypted. #131

Closed hounddog22030 closed 5 years ago

hounddog22030 commented 5 years ago

We're trying to do this with AWS Lambda Serverless and keep running into the error

Microsoft.AspNetCore.Mvc.ViewFeatures.Internal.AutoValidateAntiforgeryTokenAuthorizationFilter: Antiforgery token validation failed. The antiforgery token could not be decrypted.

I suspect it is because the Post is running on a different server?

We've tried the work-around in web.config and the IgnoreAntiforgeryTokenAttribute work-around.

Anyone else gotten this working?

Any thoughts?

normj commented 5 years ago

The Antiforgery framework in ASP.NET Core uses its underlying Data Protection framework that generates encryption keys as needed. By default the keys are persisted in memory or the file system. If you use our AWS Systems Manager ASP.NET Core Data Protection Provider package it will use AWS Systems Manager to keep the encryption key in sync for all of the compute environment running the ASP.NET Core application.

hounddog22030 commented 5 years ago

You rock (as usual)!