<?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>topic CSRF Fetch anomaly during REST API implementation in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/csrf-fetch-anomaly-during-rest-api-implementation/m-p/13962544#M2038120</link>
    <description>&lt;P&gt;I am implementing a 3rd party integration that uses basic auth (for now), fetches CSRF token and by using the received CSRF Token, I am making subsequent HTTP requests (REST). I am facing a peculiar issue. Let me write it simply:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;I fetch the CSRF token by putting the correct credentials and receive the token.&lt;/LI&gt;&lt;LI&gt;I use it to make requests and decide to close the app.&lt;/LI&gt;&lt;LI&gt;I reopen the app again and it prompts me to enter my credentials again (which it should)&lt;/LI&gt;&lt;LI&gt;I type random (incorrect) credentials in the username and password fields and click on fetch.&lt;/LI&gt;&lt;LI&gt;I still get the same token.&amp;nbsp;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Now I am not able to understand how that is possible. How does the SAP session management work? I mean if I am able to get the CSRF token regardless of my basic credentials, how is it secure? Or am I missing something in the configuration of the service in SICF? Below are the standard settings of my service that I have not changed.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Anandkarna123_0-1734071256609.png" style="width: 400px;"&gt;&lt;img src="https://community.sap.com/t5/image/serverpage/image-id/201144i569385B77833AE20/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Anandkarna123_0-1734071256609.png" alt="Anandkarna123_0-1734071256609.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Anandkarna123_2-1734071306539.png" style="width: 400px;"&gt;&lt;img src="https://community.sap.com/t5/image/serverpage/image-id/201146i1B214AFB8C0204F9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Anandkarna123_2-1734071306539.png" alt="Anandkarna123_2-1734071306539.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;My question is:&amp;nbsp;&lt;STRONG&gt;How am I able to get a CSRF Token&amp;nbsp;&lt;/STRONG&gt;(the same one which I received when I put the correct creds in the first try)&amp;nbsp;&lt;STRONG&gt;whilst putting in incorrect creds?&amp;nbsp;&lt;/STRONG&gt;Also, no matter what the creds, if I do any action (for example: create a HU number via the application), my original username (the one that I used as a part of my correct creds) is recorded in the SAP system (table: VEKP).&amp;nbsp;&lt;BR /&gt;Basically, I enter the app with incorrect creds and it seems like SAP thinks that I am the original user again (I don't know via session-cookies or something) and then allows me to make subsequent requests.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;EM&gt;Note: I am making an axios-get request from my application to the SAP server to get the CSRF token&lt;/EM&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 13 Dec 2024 06:35:52 GMT</pubDate>
    <dc:creator>Anandkarna123</dc:creator>
    <dc:date>2024-12-13T06:35:52Z</dc:date>
    <item>
      <title>CSRF Fetch anomaly during REST API implementation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/csrf-fetch-anomaly-during-rest-api-implementation/m-p/13962544#M2038120</link>
      <description>&lt;P&gt;I am implementing a 3rd party integration that uses basic auth (for now), fetches CSRF token and by using the received CSRF Token, I am making subsequent HTTP requests (REST). I am facing a peculiar issue. Let me write it simply:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;I fetch the CSRF token by putting the correct credentials and receive the token.&lt;/LI&gt;&lt;LI&gt;I use it to make requests and decide to close the app.&lt;/LI&gt;&lt;LI&gt;I reopen the app again and it prompts me to enter my credentials again (which it should)&lt;/LI&gt;&lt;LI&gt;I type random (incorrect) credentials in the username and password fields and click on fetch.&lt;/LI&gt;&lt;LI&gt;I still get the same token.&amp;nbsp;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Now I am not able to understand how that is possible. How does the SAP session management work? I mean if I am able to get the CSRF token regardless of my basic credentials, how is it secure? Or am I missing something in the configuration of the service in SICF? Below are the standard settings of my service that I have not changed.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Anandkarna123_0-1734071256609.png" style="width: 400px;"&gt;&lt;img src="https://community.sap.com/t5/image/serverpage/image-id/201144i569385B77833AE20/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Anandkarna123_0-1734071256609.png" alt="Anandkarna123_0-1734071256609.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Anandkarna123_2-1734071306539.png" style="width: 400px;"&gt;&lt;img src="https://community.sap.com/t5/image/serverpage/image-id/201146i1B214AFB8C0204F9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Anandkarna123_2-1734071306539.png" alt="Anandkarna123_2-1734071306539.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;My question is:&amp;nbsp;&lt;STRONG&gt;How am I able to get a CSRF Token&amp;nbsp;&lt;/STRONG&gt;(the same one which I received when I put the correct creds in the first try)&amp;nbsp;&lt;STRONG&gt;whilst putting in incorrect creds?&amp;nbsp;&lt;/STRONG&gt;Also, no matter what the creds, if I do any action (for example: create a HU number via the application), my original username (the one that I used as a part of my correct creds) is recorded in the SAP system (table: VEKP).&amp;nbsp;&lt;BR /&gt;Basically, I enter the app with incorrect creds and it seems like SAP thinks that I am the original user again (I don't know via session-cookies or something) and then allows me to make subsequent requests.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;EM&gt;Note: I am making an axios-get request from my application to the SAP server to get the CSRF token&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Dec 2024 06:35:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/csrf-fetch-anomaly-during-rest-api-implementation/m-p/13962544#M2038120</guid>
      <dc:creator>Anandkarna123</dc:creator>
      <dc:date>2024-12-13T06:35:52Z</dc:date>
    </item>
  </channel>
</rss>

