Open Closed

/Abp/MultiTenancy/TenantswitchModal error Antiforgery token validation failed. The antiforgery token could not be decrypted y token could not be decrypted #8546


User avatar
0
1977485679@qq.com created
  • ABP Framework version: 8.3.3
  • UI Type: Angular
  • Database System: EF Core (SQL Server)
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes
  • Exception message and full stack trace:
  • Steps to reproduce the issue:

8 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    See https://abp.io/support/questions/4603/AntiforgeryValidationException-while-trying-to-enter-SettingManagement#answer-3a09a7dc-d4bf-0b46-862a-cb116f0bf123

  • User Avatar
    0
    1977485679@qq.com created

    I tried adding this configuration, but it still doesn't work

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    The cookie is still under secure.

  • User Avatar
    0
    1977485679@qq.com created
        context.Services.AddAntiforgery(options =>
        {
            options.Cookie.SecurePolicy = CookieSecurePolicy.None;
            options.Cookie.Name = "XSRF-TOKEN";
        });
    

    Can I use this configuration?

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    No, please configure the AbpAntiForgeryOptions

  • User Avatar
    0
    1977485679@qq.com created

    I cleaned up the solution and successfully generated a new one. The AbpAntiForgeryOptions configuration will take effect. Is there any mechanism for this?

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    Does the AbpAntiForgeryOptions work in a new project but not yours?

    Could you share a test project with me, I will check it. shiwei.liang@volosoft.com

  • User Avatar
    0
    1977485679@qq.com created

    Perhaps my language expression is incorrect, but this configuration is now in effect

    thank you

Made with ❤️ on ABP v9.1.0-preview. Updated on January 02, 2025, 07:06