<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: CAP NodeJS: CSURF package deprecated in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/cap-nodejs-csurf-package-deprecated/qaa-p/12777467#M4797115</link>
    <description>&lt;P&gt;Hi Alessandro,&lt;/P&gt;&lt;P&gt;looking at the Approuter documentation for routes:&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/gregorwolf/SAP-NPM-API-collection/tree/main/apis/approuter#routes" target="test_blank"&gt;https://github.com/gregorwolf/SAP-NPM-API-collection/tree/main/apis/approuter#routes&lt;/A&gt;&lt;/P&gt;&lt;P&gt;you find the csrfProtection setting which is by default true. So if you haven't changed it to false in your xs-app.json for the managed approuter you should already have a CSRF protection for your CAP Backend that is provided in the approuter.&lt;/P&gt;&lt;P&gt;Best Regards&lt;BR /&gt;Gregor&lt;/P&gt;</description>
    <pubDate>Mon, 18 Dec 2023 13:58:21 GMT</pubDate>
    <dc:creator>gregorw</dc:creator>
    <dc:date>2023-12-18T13:58:21Z</dc:date>
    <item>
      <title>CAP NodeJS: CSURF package deprecated</title>
      <link>https://community.sap.com/t5/technology-q-a/cap-nodejs-csurf-package-deprecated/qaq-p/12777466</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
  &lt;P&gt;we are developing a CAP application (node.js) and a SAPUI5 application with managed approuter as a frontend that consume ODATA V2 from my CAP by a destination.&lt;/P&gt;
  &lt;P&gt;Following the best practices page (https://cap.cloud.sap/docs/node.js/best-practices#securing-your-application), I came across the CSRF token topic with the manual implementation.&lt;/P&gt;
  &lt;P&gt;Reading the documentation it is suggested to install the "csurf" package. Clicking on the provided link (https://www.npmjs.com/package/csurf) I discover that this is a deprecated package.&lt;BR /&gt;&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2230980-cap-securing.png" /&gt;&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2230981-cap-securing2.png" /&gt;&lt;/P&gt;
  &lt;P&gt;What other library will need to be used to maintain compatibility with the CAP application and SAPUI5 apps?&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Alessandro&lt;/P&gt;</description>
      <pubDate>Mon, 18 Dec 2023 11:42:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/cap-nodejs-csurf-package-deprecated/qaq-p/12777466</guid>
      <dc:creator>AlessandroB</dc:creator>
      <dc:date>2023-12-18T11:42:25Z</dc:date>
    </item>
    <item>
      <title>Re: CAP NodeJS: CSURF package deprecated</title>
      <link>https://community.sap.com/t5/technology-q-a/cap-nodejs-csurf-package-deprecated/qaa-p/12777467#M4797115</link>
      <description>&lt;P&gt;Hi Alessandro,&lt;/P&gt;&lt;P&gt;looking at the Approuter documentation for routes:&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/gregorwolf/SAP-NPM-API-collection/tree/main/apis/approuter#routes" target="test_blank"&gt;https://github.com/gregorwolf/SAP-NPM-API-collection/tree/main/apis/approuter#routes&lt;/A&gt;&lt;/P&gt;&lt;P&gt;you find the csrfProtection setting which is by default true. So if you haven't changed it to false in your xs-app.json for the managed approuter you should already have a CSRF protection for your CAP Backend that is provided in the approuter.&lt;/P&gt;&lt;P&gt;Best Regards&lt;BR /&gt;Gregor&lt;/P&gt;</description>
      <pubDate>Mon, 18 Dec 2023 13:58:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/cap-nodejs-csurf-package-deprecated/qaa-p/12777467#M4797115</guid>
      <dc:creator>gregorw</dc:creator>
      <dc:date>2023-12-18T13:58:21Z</dc:date>
    </item>
    <item>
      <title>Re: CAP NodeJS: CSURF package deprecated</title>
      <link>https://community.sap.com/t5/technology-q-a/cap-nodejs-csurf-package-deprecated/qaa-p/12777468#M4797116</link>
      <description>&lt;P&gt;Hi Gregor,&lt;/P&gt;&lt;P&gt;thanks for your response but i think i have a different scenario.&lt;/P&gt;&lt;P&gt;I don't have any xs-app.json file or approuter configuration on my CAP project.&lt;/P&gt;&lt;P&gt;My SAPUI5 application is located in another project (only Fiori application with managed approuter) with the xs-app.js file.&lt;/P&gt;&lt;P&gt;So, SAPUI5 application use a destination to call ODATA from CAP using the URL coming from the srv module on CAP.&lt;/P&gt;&lt;P&gt;Is it possible to enable this control for this scenario as well?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;/P&gt;&lt;P&gt;Alessandro&lt;/P&gt;</description>
      <pubDate>Tue, 19 Dec 2023 17:11:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/cap-nodejs-csurf-package-deprecated/qaa-p/12777468#M4797116</guid>
      <dc:creator>AlessandroB</dc:creator>
      <dc:date>2023-12-19T17:11:58Z</dc:date>
    </item>
    <item>
      <title>Re: CAP NodeJS: CSURF package deprecated</title>
      <link>https://community.sap.com/t5/technology-q-a/cap-nodejs-csurf-package-deprecated/qaa-p/12777469#M4797117</link>
      <description>&lt;P&gt;As you have an xs-app.json in the UI5 Project that uses the CAP Backend via the destination you can also have CSRF protection there. &lt;/P&gt;</description>
      <pubDate>Tue, 19 Dec 2023 17:27:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/cap-nodejs-csurf-package-deprecated/qaa-p/12777469#M4797117</guid>
      <dc:creator>gregorw</dc:creator>
      <dc:date>2023-12-19T17:27:26Z</dc:date>
    </item>
  </channel>
</rss>

