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:
Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

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

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

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    1977485679@qq.com created

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

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    liangshiwei created
    Fullstack Developer

    The cookie is still under secure.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • 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?

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    liangshiwei created
    Fullstack Developer

    No, please configure the AbpAntiForgeryOptions

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • 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?

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    liangshiwei created
    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

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    1977485679@qq.com created

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

    thank you

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on September 16, 2026, 14:50
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.