Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

How to disable antiforgery and/or enable cors? #7808


User avatar
0
dparizek created

I am trying to disable antiforgery at least temporarily so that I can use Telerik Reporting and it will not pass the antiforgery cookie:

@{ SetAntiForgeryCookie(); }

I can see cookie in browser console but Telerik not passing it and also Telerik talks of enabling Cors.

When I add:

Configuration.Modules.AbpWeb().AntiForgery.IsEnabled = false;

to my ApplicationModule PreInitialize method then I am missing a Using statement as it does not recognize AbpWeb()

What would be the Using statement? I tried using Abp.Configuration.Startup; no luck.

Also, I cannot find any EnableCores function in my codebase... where does that go if I want to enable Cors?


6 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team

    You can disable or configure it in your web module's PreInitialize method.

    Configuration.Modules.AbpWeb().AntiForgery.IsEnabled = false;
    

    about Cors please see: https://support.aspnetzero.com/QA/Questions/2791#answer-8fe4c107-a627-4cd5-9c6a-c00939ff2aa4

  • User Avatar
    0
    Mitch created

    HI @dparizek

    I'm about to start integrating Telerik Reporting into ASP Net Zero Core Jquery and I was wondering if you have managed to get it to work?

    It would be good to get your feedback either way.

    Many thanks

  • User Avatar
    1
    ismcagdas created
    Support Team

    Hi @mitch

    I you face any problems regarding integration of Telerik Reporting, plase let us know.

  • User Avatar
    0
    Mitch created

    Thanks @ismcagdas

    The main challenge is that Telerik Reporting needs to Add a REST Web API to the Web Application. I hope this won't cause any issues.

    https://docs.telerik.com/reporting/using-telerik-reporting-in-applications-rest-service-cache-management-overview

    https://docs.telerik.com/reporting/integrating-the-report

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @mitch

    I haven't used Telerik Reporting but I can try to help you if it causes any problems :).

  • User Avatar
    0
    ismcagdas created
    Support Team

    This issue is closed because it has not had recent activity for a long time.