https://raw.githubusercontent.com/ajmaradiaga/feeds/main/scmt/topics/SAP-BTP-Security-qa.xml SAP Community - SAP BTP Security 2024-07-26T23:00:22.912957+00:00 python-feedgen SAP BTP Security Q&A in SAP Community https://community.sap.com/t5/technology-q-a/failed-to-load-destination-caused-by-no-user-token-jwt-has-been-provided/qaq-p/13717839 Failed to load destination. Caused by: No user token (JWT) has been provided. This is strictly neces 2024-05-31T07:13:33.226000+02:00 satya-dev https://community.sap.com/t5/user/viewprofilepage/user-id/151998 <P>Hi, I am attempting to call an SAP OData service from a CAP (Cloud Application Programming) application using a CDS spawn job. I am utilizing a destination with Principal Propagation but encountering the following error:</P><P>logs:-<BR />[cds] - connect to sap_odata &gt; odata-v2 { destination: 'sap_destination', forwardAuthToken: true }<BR />2024-05-29T21:07:57.42+0530 [APP/PROC/WEB/1] ERR [remote] - Error: Error during request to remote service:<BR />2024-05-29T21:07:57.42+0530 [APP/PROC/WEB/1] ERR Failed to load destination.<BR />2024-05-29T21:07:57.42+0530 [APP/PROC/WEB/1] ERR at run (/home/vcap/app/node_modules/@sap/cds/libx/_runtime/remote/utils/client.js:310:31)<BR />2024-05-29T21:07:57.42+0530 [APP/PROC/WEB/1] ERR at process.processTicksAndRejections (node:internal/process/task_queues:95:5)<BR />2024-05-29T21:07:57.42+0530 [APP/PROC/WEB/1] ERR at async RemoteService.&lt;anonymous&gt; (/home/vcap/app/node_modules/@sap/cds/libx/_runtime/remote/Service.js:276:20)<BR />2024-05-29T21:07:57.42+0530 [APP/PROC/WEB/1] ERR at async next (/home/vcap/app/node_modules/@sap/cds/lib/srv/srv-dispatch.js:76:17)<BR />2024-05-29T21:07:57.42+0530 [APP/PROC/WEB/1] ERR at async RemoteService.handle (/home/vcap/app/node_modules/@sap/cds/lib/srv/srv-dispatch.js:74:10)<BR />2024-05-29T21:07:57.42+0530 [APP/PROC/WEB/1] ERR at async Object.methodName(/home/vcap/app/srv/util/myfile.js:102:24)<BR />2024-05-29T21:07:57.42+0530 [APP/PROC/WEB/1] ERR at async mycatfile (/home/vcap/app/srv/util/mycatfile.js:524:22) {<BR />2024-05-29T21:07:57.42+0530 [APP/PROC/WEB/1] ERR statusCode: 502,<BR />2024-05-29T21:07:57.42+0530 [APP/PROC/WEB/1] ERR reason: {<BR />2024-05-29T21:07:57.42+0530 [APP/PROC/WEB/1] ERR message: 'Error during request to remote service: \n' +<BR />2024-05-29T21:07:57.42+0530 [APP/PROC/WEB/1] ERR "Failed to load destination. Caused by: No user token (JWT) has been provided. This is strictly necessary for 'PrincipalPropagation'.",<BR />2024-05-29T21:07:57.42+0530 [APP/PROC/WEB/1] ERR request: {<BR />2024-05-29T21:07:57.42+0530 [APP/PROC/WEB/1] ERR method: 'POST',<BR />2024-05-29T21:07:57.42+0530 [APP/PROC/WEB/1] ERR url: '/xxxx/xxxxxx_SRV/dummyEntitySet',<BR />2024-05-29T21:07:57.42+0530 [APP/PROC/WEB/1] ERR headers: {<BR />2024-05-29T21:07:57.42+0530 [APP/PROC/WEB/1] ERR accept: 'application/json,text/plain',<BR />2024-05-29T21:07:57.42+0530 [APP/PROC/WEB/1] ERR 'accept-language': 'en',<BR />2024-05-29T21:07:57.42+0530 [APP/PROC/WEB/1] ERR 'content-type': 'application/json',<BR />2024-05-29T21:07:57.42+0530 [APP/PROC/WEB/1] ERR 'content-length': 311,<BR />2024-05-29T21:07:57.42+0530 [APP/PROC/WEB/1] ERR authorization: 'Bearer ...'<BR />2024-05-29T21:07:57.42+0530 [APP/PROC/WEB/1] ERR }<BR />2024-05-29T21:07:57.42+0530 [APP/PROC/WEB/1] ERR },<BR />2024-05-29T21:07:57.42+0530 [APP/PROC/WEB/1] ERR correlationId: '507a3d4f-bf6d-4296-4cc1-f6b8f070ee2b'<BR />2024-05-29T21:07:57.42+0530 [APP/PROC/WEB/1] ERR }<BR />2024-05-29T21:07:57.42+0530 [APP/PROC/WEB/1] ERR }&nbsp;</P><P>code :-&nbsp;</P><P>&nbsp;</P><pre class="lia-code-sample language-javascript"><code>const myFn = async (req, data) { cds.spawn({ user: cds.context?.user, tenant: cds.context?.tenant, headers: cds.context?.headers || req?.headers, after: iafterTime }, async (req) =&gt; { sendToSAP(req, customID) }) return 'processing in backgorund' } const sendToSAP = async (req, customID) =&gt; { const payload = {} const oSAPService = await cds.connect.to("sap_destination") let headers = { "Content-Type": "application/json" } headers.authorization = cds.context?.headers || req?.headers const response = await oSAPService.send({ method: "POST", path: "/xxxx/xxxxxx_SRV/dummyEntitySet", data: payload, headers: headers }); }</code></pre><P>&nbsp;</P><P>&nbsp;</P><DIV><DIV>&nbsp;</DIV><DIV><SPAN>"dependencies"</SPAN><SPAN>: {</SPAN></DIV><DIV><SPAN>"@sap-cloud-sdk/http-client"</SPAN><SPAN>: </SPAN><SPAN>"^3.0.1"</SPAN><SPAN>,</SPAN></DIV><DIV><SPAN>"@sap/cds"</SPAN><SPAN>: </SPAN><SPAN>"6.8.4"</SPAN><SPAN>,</SPAN></DIV><DIV><SPAN>"@sap/cds-dk"</SPAN><SPAN>: </SPAN><SPAN>"6.8.3"</SPAN><SPAN>,</SPAN></DIV><DIV><SPAN><SPAN>},<BR /></SPAN></SPAN><DIV><DIV><SPAN>"engines"</SPAN><SPAN>: {</SPAN></DIV><DIV><SPAN>"node"</SPAN><SPAN>: </SPAN><SPAN>"^18.0.0"</SPAN></DIV><DIV><SPAN>}</SPAN></DIV><DIV>&nbsp;</DIV><DIV><SPAN>this is workign without spawn job.&nbsp;</SPAN></DIV><DIV>&nbsp;</DIV></DIV></DIV></DIV> 2024-05-31T07:13:33.226000+02:00 https://community.sap.com/t5/technology-q-a/how-to-acheive-kds-based-authorization-in-capm/qaq-p/13718213 How to Acheive KDS based Authorization in CAPM ? 2024-05-31T14:44:31.944000+02:00 Jaydeepgiri https://community.sap.com/t5/user/viewprofilepage/user-id/1430181 <P><SPAN>Hello Team,</SPAN></P><P><SPAN>&nbsp;</SPAN></P><P><SPAN>We have developed a CAPM application in BAS following <A href="https://cap.cloud.sap/docs/get-started/in-a-nutshell" target="_blank" rel="nofollow noopener noreferrer">Capire Blog</A>.</SPAN></P><P><SPAN>&nbsp;</SPAN></P><P><SPAN>We have created a characteristics table which will have data related to the material characteristics and exposed this table to the service to create a UI5 application on top of it.</SPAN></P><P><SPAN>&nbsp;</SPAN></P><P><SPAN>Below is the Table definition:</SPAN></P><P>namespace Characteristics.db;</P><P>&nbsp;</P><P>using {managed} from '@sap/cds/common';</P><P>entity Characteristics : managed {</P><P>&nbsp; &nbsp; &nbsp; &nbsp; //@title &nbsp; : 'Id'</P><P>&nbsp; &nbsp; &nbsp; &nbsp; <a href="https://community.sap.com/t5/user/viewprofilepage/user-id/1445379">@ui</a>.Hidden: true</P><P>&nbsp; &nbsp; &nbsp; &nbsp; Id &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; : UUID;</P><P>&nbsp; &nbsp; key Material_No &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;: String(40);</P><P>&nbsp; &nbsp; &nbsp; &nbsp; Material_Description : String(100);</P><P>&nbsp; &nbsp; &nbsp; &nbsp; Characteristics_1 &nbsp; &nbsp;: String(100);</P><P>&nbsp; &nbsp; &nbsp; &nbsp; Description_1 &nbsp; &nbsp; &nbsp; &nbsp;: String(100);</P><P>&nbsp; &nbsp; &nbsp; &nbsp; Characteristics_2 &nbsp; &nbsp;: String(100);</P><P>&nbsp; &nbsp; &nbsp; &nbsp; Description_2 &nbsp; &nbsp; &nbsp; &nbsp;: String(100);</P><P>&nbsp; &nbsp; &nbsp; &nbsp; Characteristics_3 &nbsp; &nbsp;: String(100);</P><P>&nbsp; &nbsp; &nbsp; &nbsp; Description_3 &nbsp; &nbsp; &nbsp; &nbsp;: String(100);</P><P>&nbsp; &nbsp; &nbsp; &nbsp; Characteristics_4 &nbsp; &nbsp;: String(100);</P><P>&nbsp; &nbsp; &nbsp; &nbsp; Description_4 &nbsp; &nbsp; &nbsp; &nbsp;: String(100);</P><P>&nbsp; &nbsp; &nbsp; &nbsp; Characteristics_5 &nbsp; &nbsp;: String(100);</P><P>&nbsp; &nbsp; &nbsp; &nbsp; Description_5 &nbsp; &nbsp; &nbsp; &nbsp;: String(100);</P><P>&nbsp; &nbsp; &nbsp; &nbsp; Characteristics_6 &nbsp; &nbsp;: String(100);</P><P>&nbsp; &nbsp; &nbsp; &nbsp; Description_6 &nbsp; &nbsp; &nbsp; &nbsp;: String(100);</P><P>&nbsp; &nbsp; &nbsp; &nbsp; Characteristics_7 &nbsp; &nbsp;: String(100);</P><P>&nbsp; &nbsp; &nbsp; &nbsp; Description_7 &nbsp; &nbsp; &nbsp; &nbsp;: String(100);</P><P>&nbsp; &nbsp; &nbsp; &nbsp; Characteristics_8 &nbsp; &nbsp;: String(100);</P><P>&nbsp; &nbsp; &nbsp; &nbsp; Description_8 &nbsp; &nbsp; &nbsp; &nbsp;: String(100);</P><P>&nbsp; &nbsp; &nbsp; &nbsp; Characteristics_9 &nbsp; &nbsp;: String(100);</P><P>&nbsp; &nbsp; &nbsp; &nbsp; Description_9 &nbsp; &nbsp; &nbsp; &nbsp;: String(100);</P><P>&nbsp; &nbsp; &nbsp; &nbsp; Characteristics_10 &nbsp; : String(100);</P><P>&nbsp; &nbsp; &nbsp; &nbsp; Description_10 &nbsp; &nbsp; &nbsp; : String(100);</P><P>&nbsp; &nbsp; &nbsp; &nbsp; Characteristics_11 &nbsp; : String(100);</P><P>&nbsp; &nbsp; &nbsp; &nbsp; Description_11 &nbsp; &nbsp; &nbsp; : String(100);</P><P>&nbsp; &nbsp; &nbsp; &nbsp; Characteristics_12 &nbsp; : String(100);</P><P>&nbsp; &nbsp; &nbsp; &nbsp; Description_12 &nbsp; &nbsp; &nbsp; : String(100);</P><P>&nbsp; &nbsp; &nbsp; &nbsp; Characteristics_13 &nbsp; : String(100);</P><P>&nbsp; &nbsp; &nbsp; &nbsp; Description_13 &nbsp; &nbsp; &nbsp; : String(100);</P><P>&nbsp; &nbsp; &nbsp; &nbsp; Characteristics_14 &nbsp; : String(100);</P><P>&nbsp; &nbsp; &nbsp; &nbsp; Description_14 &nbsp; &nbsp; &nbsp; : String(100);</P><P>&nbsp; &nbsp; &nbsp; &nbsp; Characteristics_15 &nbsp; : String(100);</P><P>&nbsp; &nbsp; &nbsp; &nbsp; Description_15 &nbsp; &nbsp; &nbsp; : String(100);</P><P>&nbsp; &nbsp; &nbsp; &nbsp; Characteristics_16 &nbsp; : String(100);</P><P>&nbsp; &nbsp; &nbsp; &nbsp; Description_16 &nbsp; &nbsp; &nbsp; : String(100);</P><P>&nbsp; &nbsp; &nbsp; &nbsp; Characteristics_17 &nbsp; : String(100);</P><P>&nbsp; &nbsp; &nbsp; &nbsp; Description_17 &nbsp; &nbsp; &nbsp; : String(100);</P><P>&nbsp; &nbsp; &nbsp; &nbsp; Characteristics_18 &nbsp; : String(100);</P><P>&nbsp; &nbsp; &nbsp; &nbsp; Description_18 &nbsp; &nbsp; &nbsp; : String(100);</P><P>&nbsp; &nbsp; &nbsp; &nbsp; Characteristics_19 &nbsp; : String(100);</P><P>&nbsp; &nbsp; &nbsp; &nbsp; Description_19 &nbsp; &nbsp; &nbsp; : String(100);</P><P>&nbsp; &nbsp; &nbsp; &nbsp; Characteristics_20 &nbsp; : String(100);</P><P>&nbsp; &nbsp; &nbsp; &nbsp; Description_20 &nbsp; &nbsp; &nbsp; : String(100);</P><P>&nbsp; &nbsp; &nbsp; &nbsp; //Auto Populated fields</P><P>&nbsp; &nbsp; &nbsp; &nbsp; createdAt &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;: Timestamp &nbsp; &nbsp;<a href="https://community.sap.com/t5/user/viewprofilepage/user-id/1434188">@CDS</a>.on.insert: $now;</P><P>&nbsp; &nbsp; &nbsp; &nbsp; createdBy &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;: String(100) &nbsp;<a href="https://community.sap.com/t5/user/viewprofilepage/user-id/1434188">@CDS</a>.on.insert: $user;</P><P>&nbsp; &nbsp; &nbsp; &nbsp; modifiedAt &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; : Timestamp &nbsp; &nbsp;<a href="https://community.sap.com/t5/user/viewprofilepage/user-id/1434188">@CDS</a>.on.insert: $now &nbsp; <a href="https://community.sap.com/t5/user/viewprofilepage/user-id/1434188">@CDS</a>.on.update: $now;</P><P>&nbsp; &nbsp; &nbsp; &nbsp; modifiedBy &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; : String(100) &nbsp;<a href="https://community.sap.com/t5/user/viewprofilepage/user-id/1434188">@CDS</a>.on.insert: $user &nbsp;<a href="https://community.sap.com/t5/user/viewprofilepage/user-id/1434188">@CDS</a>.on.update: $user;</P><P>&nbsp;</P><P>}</P><P>&nbsp;</P><P><SPAN>}</SPAN></P><P><SPAN>&nbsp;</SPAN></P><P><SPAN>&nbsp;</SPAN></P><P><SPAN>Below is the service created:</SPAN></P><P><SPAN>&nbsp;</SPAN></P><P>using {Characteristics.db as db} from '../db/YTPOnePlanning-db';</P><P>&nbsp;</P><P>service CatalogService @(require: 'authenticated-user') {</P><P>&nbsp;</P><P>&nbsp; &nbsp; @odata.draft.enabled: true</P><P>&nbsp; &nbsp; entity Characteristics @(restrict: [</P><P>&nbsp;</P><P>&nbsp; &nbsp; &nbsp; &nbsp; {</P><P>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; grant: ['*'],</P><P>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; to &nbsp; : 'YTPOnePlanning_admin.hdbrole'</P><P>&nbsp; &nbsp; &nbsp; &nbsp; },</P><P>&nbsp; &nbsp; &nbsp; &nbsp; {</P><P>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; grant: ['READ'],</P><P>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; to &nbsp; : 'YTPOnePlanning_read.hdbrole'</P><P>&nbsp; &nbsp; &nbsp; &nbsp; }</P><P>&nbsp;</P><P>&nbsp; &nbsp; ]) as projection on db.Characteristics;</P><P>&nbsp;</P><P>}</P><P>&nbsp;</P><P><SPAN>The application is working fine as expected. We are able to see all the details from the HANA table to the FIORI Screen.</SPAN></P><P>&nbsp;</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Jaydeepgiri_3-1717159315782.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/118159iC0C8FC0F679F248C/image-size/medium?v=v2&amp;px=400" role="button" title="Jaydeepgiri_3-1717159315782.png" alt="Jaydeepgiri_3-1717159315782.png" /></span></P><P>&nbsp;</P><P><SPAN>&nbsp;</SPAN></P><P>Now as you can see below in the service definition, we have defined service based on roles provided to the users. For example. If user is assigned 'YTPOnePlanning_admin.hdbrole' role then that user can perform all the CRUD operations and if the user is assigned 'YTPOnePlanning_read.hdbrole' role then the user can only read the data.</P><P><SPAN>&nbsp;</SPAN></P><P><SPAN>&nbsp;</SPAN></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Jaydeepgiri_1-1717159202736.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/118156iCEC7D3933C5EE633/image-size/medium?v=v2&amp;px=400" role="button" title="Jaydeepgiri_1-1717159202736.png" alt="Jaydeepgiri_1-1717159202736.png" /></span></P><P>&nbsp;</P><P><SPAN>&nbsp;</SPAN></P><P><SPAN>&nbsp;</SPAN></P><P><SPAN>&nbsp;</SPAN></P><P><SPAN>&nbsp;</SPAN></P><P><SPAN>All of which is fine and understood, but <U>what we are trying to achieve is authorization on based of KDS ( Key data structure ) i.e. if the Database table has 100 Materials and the user ‘X’ only has permission to perform CRUD operation on 10 Material then the user ‘X’ shall only have access to those 10 materials.</U></SPAN></P><P><SPAN>&nbsp;</SPAN></P><P><SPAN>Could you please help us achieve this functionality ?</SPAN></P><P><SPAN>&nbsp;</SPAN></P> 2024-05-31T14:44:31.944000+02:00 https://community.sap.com/t5/technology-q-a/how-to-fetch-current-user-s-email-address-in-btp-rap-method/qaq-p/13721485 How to fetch Current User's Email Address in BTP RAP Method 2024-06-05T07:17:23.710000+02:00 NITIN_SAPRS https://community.sap.com/t5/user/viewprofilepage/user-id/156832 <P>Hi Experts,</P><P>I need to fetch the Current User's Email Address in my BTP RAP Method but the Class "<SPAN>cl_abap_context_info</SPAN>" don't have any method to fetch the same.</P><P>Please help hot to get the Email Address of the user..</P><P>Thanks,</P><P>BTP Learner</P> 2024-06-05T07:17:23.710000+02:00 https://community.sap.com/t5/technology-q-a/cors-blocking-access/qaq-p/13721719 CORS blocking access 2024-06-05T11:09:35.453000+02:00 hagarnabil https://community.sap.com/t5/user/viewprofilepage/user-id/872532 <P>Hi everyone,<BR /><BR />I'm facing an issue with CORS blocking access in my application, below is what I've done in my frontend and backend applications.</P><P>In the frontend app I'm using angular to make this login request&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><pre class="lia-code-sample language-java"><code>const headers = new HttpHeaders({ 'Authorization': 'Basic ' + btoa(${this.clientID}:${this.clientSecret}), 'Content-Type': 'application/x-www-form-urlencoded', 'Access-Control-Allow-Origin': '*' }); return this.http .post&lt;AuthResponseBackend&gt;( 'https://cors-anywhere.herokuapp.com/https://amwftwpkt.trial-accounts.ondemand.com/oauth2/token', data.toString(), { headers } )</code></pre><P>&nbsp;</P><P>&nbsp;</P><P>it works only if I add this CORS link&nbsp;<A href="http:// https://cors-anywhere.herokuapp.com/" target="_self" rel="nofollow noopener noreferrer"> https://cors-anywhere.herokuapp.com/</A>&nbsp; before login link and open that link in my browser<A href="http:// https://cors-anywhere.herokuapp.com/corsdemo" target="_self" rel="nofollow noopener noreferrer"> https://cors-anywhere.herokuapp.com/corsdemo</A>&nbsp; to request temporary access to the demo server. I need it to work without these CORS links.</P><P>In the backend application, I'm working with spring boot and using security configuration. I've added allow CORS configuration in my security configuration as shown in my code snippets below and also above each controller I've added the CrossOrigin annotation. When I deploy my application on kyma and the frontend side tries to connect to it, It still gives an error due to CORS. Any help is appreciated.&nbsp;</P><P>Here are the github links for the full codes of the applications;&nbsp;<A href="https://github.com/amirafathy-tech/BTP-SD-APP/tree/master" target="_self" rel="nofollow noopener noreferrer">Frontend application</A>&nbsp;,&nbsp;<A href="https://github.com/hagarrnabil/BTP-SD" target="_self" rel="nofollow noopener noreferrer">Backend application</A>&nbsp;</P><P>Thanks in advance.</P><P>&nbsp;</P><P>&nbsp;</P><pre class="lia-code-sample language-java"><code> @Bean public CorsConfigurationSource corsConfigurationSource() { CorsConfiguration corsConfiguration = new CorsConfiguration(); corsConfiguration.setAllowedOrigins(List.of("http://localhost:4200")); corsConfiguration.setAllowedMethods(List.of("GET", "POST", "DELETE", "PUT")); corsConfiguration.setAllowCredentials(true); corsConfiguration.setAllowedHeaders(List.of("*")); corsConfiguration.setMaxAge(3600L); UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); source.registerCorsConfiguration("/**", corsConfiguration); return source; }</code></pre><pre class="lia-code-sample language-java"><code> @Bean public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { // @formatter:off http.sessionManagement(sess -&gt; sess.sessionCreationPolicy(SessionCreationPolicy.STATELESS)) .authorizeHttpRequests(authz -&gt; authz.requestMatchers("/measurements/*").hasRole("USER") .requestMatchers("/formulas/*").hasRole("USER") .requestMatchers("/linetypes/*").hasRole("USER") .requestMatchers("/materialgroups/*").hasRole("USER") .requestMatchers("/modelspecs/*").hasRole("USER") .requestMatchers("/modelspecdetails/*").hasRole("USER") .requestMatchers("/personnelnumbers/*").hasRole("USER") .requestMatchers("/servicenumbers/*").hasRole("USER") .requestMatchers("/servicetypes/*").hasRole("USER") .requestMatchers("/*").authenticated() .anyRequest().denyAll()) .oauth2ResourceServer(oauth2 -&gt; oauth2.jwt(jwt -&gt; jwt.jwtAuthenticationConverter(new MyCustomHybridTokenAuthenticationConverter()))); http.cors(httpSecurityCorsConfigurer -&gt; httpSecurityCorsConfigurer.configurationSource(corsConfigurationSource())); http.csrf(csrf -&gt; csrf.disable()); return http.build(); }</code></pre><pre class="lia-code-sample language-java"><code>@CrossOrigin(origins = "http://localhost:4200", maxAge = 3600)</code></pre><P>&nbsp;</P><P>&nbsp;</P> 2024-06-05T11:09:35.453000+02:00 https://community.sap.com/t5/technology-q-a/problem-unable-to-call-protected-app-from-another-app/qaq-p/13721830 Problem -Unable to call protected app from another App. 2024-06-05T12:14:18.039000+02:00 somnathsap https://community.sap.com/t5/user/viewprofilepage/user-id/857377 <P>Hi Expert,<BR />I have created two CAP applications, each with its own XSUAA authentication service. I want to call one CAP service from another CAP application. I followed&nbsp;<a href="https://community.sap.com/t5/user/viewprofilepage/user-id/5495">@CarlosRoggan</a>&nbsp; blog&nbsp;<A href="https://community.sap.com/t5/technology-blogs-by-sap/how-to-call-protected-app-from-external-app-as-external-user-with-scope/ba-p/13440813" target="_new">here</A>, which worked perfectly for external users but failed for the application-to-application case.<BR /><BR /></P><P>I followed the exact steps, but the user JWT token doesn't contain the provider app scope when doing it for another application. However, it works perfectly for external users. Please help me.<BR /><a href="https://community.sap.com/t5/user/viewprofilepage/user-id/5495">@CarlosRoggan</a>&nbsp;<a href="https://community.sap.com/t5/user/viewprofilepage/user-id/12545">@gregorw</a>&nbsp;<a href="https://community.sap.com/t5/user/viewprofilepage/user-id/789">@MioYasutake</a>&nbsp;<a href="https://community.sap.com/t5/user/viewprofilepage/user-id/744">@Ivan-Mirisola</a>&nbsp;<BR /><BR />Thanks<BR />Somnath</P> 2024-06-05T12:14:18.039000+02:00 https://community.sap.com/t5/technology-q-a/unable-to-run-a-python-flask-app-on-btp-with-x-csrf-token-requirement/qaq-p/13724891 Unable to run a Python Flask app on BTP with X-CSRF token requirement 2024-06-09T03:15:55.133000+02:00 AndreasMuno https://community.sap.com/t5/user/viewprofilepage/user-id/3113 <P>Hi experts,&nbsp;</P><P>a Python Flask app shall be deployed to an SAP BTP Cloud Foundry subaccount with a web server handling security (XSUAA). The app appears to work well during local tests, or when XSUAA is locally simulated. However, as soon as the app is pushed to the BTP subaccount with XSUAA any modifying POST results in a 'Forbidden' response. When analyzing the respective logs, this response stood out: "<SPAN>POST request to /curate/279/update completed with status 403 The request does not contain a x-csrf-token</SPAN>".&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</P><P>I did attempt to implement the following code to obtain&nbsp;the <SPAN>x-csrf-token</SPAN> in GET and use it in the header<SPAN>&nbsp;in POST, but failed to obtain a value for&nbsp;x-csrf-token in GET.&nbsp;</SPAN></P><P><SPAN>Perhaps one of you could help figure out how I could get&nbsp;a value for&nbsp;x-csrf-token in GET?&nbsp;<BR />Thank you.</SPAN></P><P>&nbsp;</P><DIV><DIV><SPAN>&nbsp; &nbsp; </SPAN><SPAN># x-csrf-token</SPAN></DIV><DIV><SPAN>&nbsp; &nbsp; </SPAN><SPAN>lbl_csrf</SPAN> <SPAN>=</SPAN> <SPAN>'x-csrf-token'</SPAN></DIV><DIV><SPAN>&nbsp; &nbsp; </SPAN><SPAN>headers</SPAN> <SPAN>=</SPAN><SPAN> {</SPAN><SPAN>lbl_csrf</SPAN><SPAN>: </SPAN><SPAN>'Fetch'</SPAN><SPAN>}</SPAN></DIV><DIV><SPAN>&nbsp; &nbsp; </SPAN><SPAN>url_suffix</SPAN> <SPAN>=</SPAN> <SPAN>f</SPAN><SPAN>"</SPAN><SPAN>{</SPAN><SPAN>id</SPAN><SPAN>}</SPAN><SPAN>/update"</SPAN></DIV><DIV><SPAN>&nbsp; &nbsp; </SPAN><SPAN>endpt_url</SPAN> <SPAN>=</SPAN> <SPAN>'/'</SPAN><SPAN>.</SPAN><SPAN>join</SPAN><SPAN>([</SPAN><SPAN>xsuaa_service_url</SPAN><SPAN>(), </SPAN><SPAN>url_suffix</SPAN><SPAN>])</SPAN></DIV><DIV><SPAN>&nbsp; &nbsp; </SPAN><SPAN>x_csrf_token</SPAN> <SPAN>=</SPAN> <SPAN>None</SPAN></DIV></DIV><DIV>&nbsp;</DIV><DIV>...within a Blueprint route definition I included this code:<BR /><DIV><SPAN>&nbsp; &nbsp; </SPAN></DIV><DIV><SPAN>## Connect to the server</SPAN></DIV><DIV><SPAN>&nbsp; &nbsp; </SPAN><SPAN>with</SPAN> <SPAN>requests</SPAN><SPAN>.</SPAN><SPAN>Session</SPAN><SPAN>() </SPAN><SPAN>as</SPAN> <SPAN>s</SPAN><SPAN>:</SPAN></DIV><DIV><SPAN>&nbsp; &nbsp; &nbsp; &nbsp; </SPAN><SPAN>response</SPAN> <SPAN>=</SPAN> <SPAN>s</SPAN><SPAN>.</SPAN><SPAN>get</SPAN><SPAN>(</SPAN><SPAN>endpt_url</SPAN><SPAN>, </SPAN><SPAN>headers</SPAN><SPAN>=</SPAN><SPAN>headers</SPAN><SPAN>, </SPAN><SPAN>cookies</SPAN><SPAN>=</SPAN><SPAN>s</SPAN><SPAN>.</SPAN><SPAN>cookies</SPAN><SPAN>)</SPAN></DIV><DIV><SPAN>&nbsp; &nbsp; &nbsp; &nbsp; </SPAN><SPAN>if</SPAN> <SPAN>response</SPAN> <SPAN>and</SPAN> <SPAN>hasattr</SPAN><SPAN>(</SPAN><SPAN>response</SPAN><SPAN>, </SPAN><SPAN>'headers' )</SPAN></DIV><DIV><SPAN>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </SPAN><SPAN>current_app</SPAN><SPAN>.</SPAN><SPAN>logger</SPAN><SPAN>.</SPAN><SPAN>info</SPAN><SPAN>(</SPAN><SPAN>"GET headers: </SPAN><SPAN>%s</SPAN><SPAN>, cookies: </SPAN><SPAN>%s</SPAN><SPAN>"</SPAN><SPAN>, </SPAN></DIV><DIV><SPAN>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </SPAN><SPAN>response</SPAN><SPAN>.</SPAN><SPAN>headers</SPAN><SPAN>, </SPAN><SPAN>response</SPAN><SPAN>.</SPAN><SPAN>cookies</SPAN><SPAN>)</SPAN></DIV><DIV><SPAN>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </SPAN><SPAN>if</SPAN> <SPAN>hasattr</SPAN><SPAN>(</SPAN><SPAN>response</SPAN><SPAN>.</SPAN><SPAN>headers</SPAN><SPAN>, </SPAN><SPAN>lbl_csrf )</SPAN></DIV><DIV><SPAN>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</SPAN><SPAN>x_csrf_token</SPAN> <SPAN>=</SPAN> <SPAN>response</SPAN><SPAN>.</SPAN><SPAN>headers</SPAN><SPAN>[</SPAN><SPAN>lbl_csrf</SPAN><SPAN>]</SPAN></DIV><DIV><SPAN>&nbsp; &nbsp; &nbsp; &nbsp; </SPAN><SPAN>current_app</SPAN><SPAN>.</SPAN><SPAN>logger</SPAN><SPAN>.</SPAN><SPAN>info</SPAN><SPAN>(</SPAN><SPAN>"GET: x-csrf-token: </SPAN><SPAN>%s</SPAN><SPAN>"</SPAN><SPAN>, </SPAN><SPAN>x_csrf_token</SPAN><SPAN>)</SPAN></DIV><DIV><SPAN>&nbsp; &nbsp; </SPAN></DIV><DIV><SPAN>&nbsp; &nbsp; </SPAN><SPAN>if</SPAN> <SPAN>request</SPAN><SPAN>.</SPAN><SPAN>method</SPAN> <SPAN>==</SPAN> <SPAN>'POST'</SPAN><SPAN>:</SPAN></DIV><DIV><SPAN>&nbsp; &nbsp; &nbsp; &nbsp; </SPAN><SPAN># x-csrf-token</SPAN></DIV><DIV><SPAN>&nbsp; &nbsp; &nbsp; &nbsp; </SPAN><SPAN>if</SPAN> <SPAN>x_csrf_token</SPAN><SPAN>:</SPAN></DIV><DIV><SPAN>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </SPAN><SPAN>headers</SPAN><SPAN>=</SPAN><SPAN>{</SPAN><SPAN>'Content-Type'</SPAN><SPAN>:</SPAN><SPAN>'application/json'</SPAN><SPAN>, </SPAN><SPAN>lbl_csrf</SPAN><SPAN>: </SPAN><SPAN>x_csrf_token</SPAN><SPAN>}</SPAN></DIV><DIV><SPAN>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </SPAN><SPAN>with</SPAN> <SPAN>requests</SPAN><SPAN>.</SPAN><SPAN>Session</SPAN><SPAN>() </SPAN><SPAN>as</SPAN> <SPAN>s</SPAN><SPAN>:</SPAN></DIV><DIV><SPAN>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </SPAN><SPAN>resp</SPAN> <SPAN>=</SPAN> <SPAN>s</SPAN><SPAN>.</SPAN><SPAN>post</SPAN><SPAN>(</SPAN><SPAN>endpt_url</SPAN><SPAN>, </SPAN><SPAN>headers</SPAN><SPAN>=</SPAN><SPAN>headers</SPAN><SPAN>, </SPAN><SPAN>cookies</SPAN><SPAN>=</SPAN><SPAN>s</SPAN><SPAN>.</SPAN><SPAN>cookies</SPAN><SPAN>)</SPAN></DIV><DIV><SPAN>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </SPAN><SPAN>current_app</SPAN><SPAN>.</SPAN><SPAN>logger</SPAN><SPAN>.</SPAN><SPAN>info</SPAN><SPAN>(</SPAN><SPAN>"POST headers: </SPAN><SPAN>%s</SPAN><SPAN>, </SPAN><SPAN>%s</SPAN><SPAN>"</SPAN><SPAN>, </SPAN><SPAN>resp</SPAN><SPAN>, </SPAN><SPAN>headers</SPAN><SPAN>, </SPAN><SPAN>s</SPAN><SPAN>.</SPAN><SPAN>cookies</SPAN><SPAN>)</SPAN></DIV></DIV><P>&nbsp;</P> 2024-06-09T03:15:55.133000+02:00 https://community.sap.com/t5/crm-and-cx-questions/inbound-communication-on-sap-btp-and-cloud-foundry-application/qaq-p/13729995 Inbound Communication on SAP BTP and Cloud Foundry Application 2024-06-13T15:37:44.889000+02:00 fmartucci https://community.sap.com/t5/user/viewprofilepage/user-id/1472510 <P>Hi,</P><P>I'm studying the SAP BTP and have a question about it.</P><P>Here’s the scenario: from C4C, using a webhook (triggered by a ticket update), an HTTP request is sent to an application (python-based) I developed and deployed on Cloud Foundry in the BTP. This application performs certain tasks and then connects to the SAP AI Core service.</P><P>My concern is about managing communications securely (authentication, etc.) both inbound and outbound from my application. If I understand correctly, I can use "destinations" to manage outbound communications. However, it's not clear to me how to handle inbound communications: at the moment, anyone who has the endpoint where my application is exposed can access the service. So, how do I implement an authentication mechanism?</P><P>I’ve looked through the documentation, the Learning Hub, and community blogs, but I’m a little bit confused. For example, I learned about the XSUAA service, but it permits to design a login form for any user, that is not what I need, since I want a secure communication between C4C and my application.</P> 2024-06-13T15:37:44.889000+02:00 https://community.sap.com/t5/technology-q-a/problem-registering-my-desktop-agent-in-my-btp-build-process-automation/qaq-p/13735868 Problem registering my desktop agent in my BTP Build Process Automation Trial Account 2024-06-19T09:29:23.588000+02:00 Ilyass01 https://community.sap.com/t5/user/viewprofilepage/user-id/1433801 <P>Hi everyone,</P><P>I'm facing an issue while registering my Desktop agent in my BTP Trial Build Process Automation App.</P><P>I followed the SAP Developers Guide to set up the agent locally on my PC, and I enabled the Chrome and Edge extensions to try and connect the agent with my trial app. However, I encounter a problem when clicking on the agent in the control tower to get the information needed to register it with my local desktop agent.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ilyass01_0-1718781779821.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/125440iD2068DDABB258B71/image-size/medium?v=v2&amp;px=400" role="button" title="Ilyass01_0-1718781779821.png" alt="Ilyass01_0-1718781779821.png" /></span></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ilyass01_1-1718781961409.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/125441i5F2C82F42B50D82B/image-size/medium?v=v2&amp;px=400" role="button" title="Ilyass01_1-1718781961409.png" alt="Ilyass01_1-1718781961409.png" /></span></P><P>It loads for hours without any response. I thought it might be due to my internet connection, but nothing changed after switching to another Wi-Fi network.</P><P>Can you please help me set this up?</P><P>Thanks,<BR />Ilyass</P> 2024-06-19T09:29:23.588000+02:00 https://community.sap.com/t5/technology-q-a/how-to-secure-your-cloud-foundry-python-application-with-xsuaa/qaq-p/13736667 How to Secure Your Cloud Foundry Python Application with XSUAA. 2024-06-19T21:27:50.810000+02:00 Harsh_Tirhekar https://community.sap.com/t5/user/viewprofilepage/user-id/1475351 <P>&nbsp;</P><H1 id="toc-hId-888499072">How to Secure Your Cloud Foundry Python Application with XSUAA</H1><H2 id="toc-hId-821068286">Introduction</H2><P>Securing applications in the cloud is critical to ensure that sensitive data and operations are protected from unauthorized access. SAP Cloud Foundry offers a robust way to handle authentication and authorization using the XSUAA (Extended Services User Account and Authentication) service. By leveraging XSUAA, developers can implement security measures that integrate seamlessly with SAP Cloud Platform, providing OAuth 2.0-based security mechanisms.</P><P>In this blog post, I'll walk you through the process of applying XSUAA security to a Python application deployed on Cloud Foundry using the Python Buildpack. Whether you're new to SAP Cloud Platform or looking to secure your existing applications, this guide will help you understand the steps involved and save you time in the process. We'll cover everything from setting up your environment to deploying and testing your secure application, ensuring you have a comprehensive understanding of the entire workflow.</P><P>Let's dive in and secure your Python application with XSUAA on Cloud Foundry!</P><H2 id="toc-hId-624554781">Step-by-Step Guide</H2><H3 id="toc-hId-557123995">1. Setting Up Your Environment</H3><P>Create a new project directory:</P><PRE>mkdir cf-python-xsuaa cd cf-python-xsuaa</PRE><H3 id="toc-hId-360610490">2. Create hello.py file</H3><P>Create a new file named hello.py with the following content:</P><PRE>import os from flask import Flask, request, abort from cfenv import AppEnv import jwt from sap import xssec app = Flask(__name__) env = AppEnv() port = int(os.environ.get('PORT', 3000)) uaa_service = env.get_service(name='xsuaa_service_name').credentials @app.route('/') def hello(): if 'authorization' not in request.headers: abort(403) access_token = request.headers.get('authorization')[7:] print(jwt.decode(access_token, options={"verify_signature": False})) security_context = xssec.create_security_context(access_token, uaa_service) isAuthorized = security_context.check_scope('uaa.resource') print(isAuthorized) print(security_context) print(access_token) if not isAuthorized: abort(403) return "Hello World" if __name__ == '__main__': app.run(host='0.0.0.0', port=port)</PRE><H3 id="toc-hId-164096985">3. Create manifest.yml file</H3><P>Create a manifest.yml file with the following content:</P><PRE>--- applications: - name: cf-python-xsuaa memory: 128MB disk_quota: 256MB random-route: true buildpack: python_buildpack command: python hello.py services: - xsuaa_service_name</PRE><H3 id="toc-hId--32416520">4. Create requirements.txt file</H3><P>Create a requirements.txt file with the following dependencies:</P><PRE>Flask gunicorn cfenv sap-xssec PyJWT</PRE><H3 id="toc-hId--228930025">5. Create xs-security.json file</H3><P>Create an xs-security.json file with the following content:</P><PRE>{ "xsappname": "xsuaa_service_name", "tenant-mode": "dedicated" }</PRE><H3 id="toc-hId--425443530">6. Install Dependencies and Run Locally</H3><P>Set up a virtual environment and install dependencies:</P><PRE>python -m venv venv .\venv\Scripts\activate pip install -r requirements.txt</PRE><P>Run the application locally:</P><PRE>python hello.py</PRE><H3 id="toc-hId--621957035">7. Deploy to Cloud Foundry</H3><P>Log in to Cloud Foundry:</P><PRE>cf login</PRE><P>Create the XSUAA service instance:</P><PRE>cf create-service xsuaa application xsuaa_service_name -c xs-security.json</PRE><P>Deploy the application:</P><PRE>cf push</PRE><P>Create a service key for the XSUAA service:</P><PRE>cf create-service-key xsuaa_service_name xsuaa_service_key</PRE><P>Retrieve the service key:</P><PRE>cf service-key xsuaa_service_name xsuaa_service_key</PRE><H3 id="toc-hId--893701909">8. Test Your Application with Postman</H3><P>Generate a token using Postman:</P><UL><LI>Open Postman and create a new POST request to the URL:</LI><LI>Example URL: <A href="https://abc-interns.authentication.eu12.hana.ondemand.com/oauth/token?grant_type=client_credentials" target="_blank" rel="noopener nofollow noreferrer">https://abc-interns.authentication.eu12.hana.ondemand.com/oauth/token?grant_type=client_credentials</A></LI><LI>Set the headers:<UL><LI>Content-Type: application/json</LI><LI>Authorization: Basic Auth with your client_id and client_secret</LI><UL><LI>Username: your_client_id</LI><LI>Password: your_client_secret</LI></UL></UL></LI></UL><P>Use the generated token to access your secure endpoint:</P><UL><LI>Create a new GET request in Postman to the URL of your deployed application:</LI><LI>Example URL: <A href="https://cf-python-xsuaa-agile-cat-cs.cfapps.eu12.hana.ondemand.com/" target="_blank" rel="noopener nofollow noreferrer">https://cf-python-xsuaa-agile-cat-cs.cfapps.eu12.hana.ondemand.com/</A></LI><LI>Set the headers:<UL><LI>Content-Type: application/json</LI><LI>Authorization: Bearer YOUR_ACCESS_TOKEN</LI></UL></LI></UL><P>Replace YOUR_ACCESS_TOKEN with the token you obtained from the previous step.</P><H2 id="toc-hId--796812407">Conclusion</H2><P>By following these steps, you’ve successfully secured your Python application on Cloud Foundry using XSUAA. This method provides a robust authentication and authorization mechanism, ensuring that your application is protected from unauthorized access.</P><H2 id="toc-hId--993325912">Additional Resources</H2><UL><LI>SAP Cloud Platform XSUAA Documentation</LI><LI>Cloud Foundry Documentation</LI><LI>Python Buildpack Documentation</LI></UL><H2 id="toc-hId--1189839417">Call to Action</H2><P>Try securing your applications and help others also in comments and post your experiences in SAP Community.</P><P>Thanks and regards,</P><P>Harsh Tirhekar</P> 2024-06-19T21:27:50.810000+02:00 https://community.sap.com/t5/technology-q-a/how-to-secure-endpoints-in-sap-btp-and-user-authentication/qaq-p/13741673 How to Secure Endpoints in SAP BTP AND User Authentication 2024-06-25T07:49:47.834000+02:00 RiturajKumar https://community.sap.com/t5/user/viewprofilepage/user-id/1473871 <P>Hi SAP Community,<BR /><BR />I am currently working on securing the endpoints in SAP Business Technology Platform (BTP) and would appreciate some guidance on best practices and available methods for implementing robust security measures, particularly focusing on user authentication.<BR /><BR /><BR />Thanks&nbsp;<BR />Rituraj Kumar</P> 2024-06-25T07:49:47.834000+02:00 https://community.sap.com/t5/technology-q-a/monitor-credit-consumption-to-prevent-over-usage/qaq-p/13743392 Monitor credit consumption to prevent over usage 2024-06-26T15:46:55.036000+02:00 AxelGrille1 https://community.sap.com/t5/user/viewprofilepage/user-id/1415060 <H1 id="toc-hId-889330425"><SPAN>SAP BTP Credits</SPAN></H1><H2 id="toc-hId-821899639"><SPAN>Early Warning</SPAN></H2><P><SPAN>&nbsp;</SPAN></P><H1 id="toc-hId-496303415"><SPAN>Introduction:</SPAN></H1><P><SPAN>Many BTP customers have negotiated contracts with SAP for their BTP credits. To prevent credit overconsumption, an usage predictor can be very helpful. Therefore, we propose implementing a detailed tracker with a usage prediction feature.</SPAN></P><P><SPAN>&nbsp;</SPAN></P><H1 id="toc-hId-299789910"><SPAN>Usage Prediction Model:</SPAN></H1><P><SPAN>Since business operations are often cyclical, we base our predictions on the usage from the previous two months. This approach could also account for seasonal variations.</SPAN></P><P><SPAN>&nbsp;</SPAN></P><P><SPAN>Steps to Implement the Tracker:</SPAN></P><P><SPAN>&nbsp;</SPAN></P><H3 id="toc-hId-361441843"><SPAN>1. Data Retrieval:</SPAN></H3><P><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;We will use the Usage Data Management Service API to gather consumption data for each global account and its associated subaccounts.</SPAN></P><P><SPAN>&nbsp;</SPAN></P><H3 id="toc-hId-164928338"><SPAN>2. Data Processing:</SPAN></H3><P><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;The daily usage data for each subaccount will be classified and filtered to retain only the data from the last two months.</SPAN></P><P><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;We will then compute the sliding means for each subaccount. This involves averaging the daily usage over the past two months.</SPAN></P><P><SPAN>&nbsp;</SPAN></P><H3 id="toc-hId--31585167"><SPAN>3. Prediction Calculation:</SPAN></H3><P><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;The computed sliding means will be multiplied by the number of days remaining in the current month to predict future usage.</SPAN></P><P><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;This prediction accounts for seasonality, providing a more accurate forecast shifted by two months..</SPAN></P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="AxelGrille1_0-1719409472467.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/129012iDB431C864325FF40/image-size/medium?v=v2&amp;px=400" role="button" title="AxelGrille1_0-1719409472467.png" alt="AxelGrille1_0-1719409472467.png" /></span></P><P>&nbsp;</P><P><SPAN>&nbsp;</SPAN></P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="AxelGrille1_1-1719409472470.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/129013iD9E520F7541B8769/image-size/medium?v=v2&amp;px=400" role="button" title="AxelGrille1_1-1719409472470.png" alt="AxelGrille1_1-1719409472470.png" /></span></P><P>&nbsp;</P><H3 id="toc-hId--228098672"><SPAN>4. Alert System:</SPAN></H3><P><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;Based on the predictions, an alert will be sent to the account owner if they are likely to over consume their credits. The alert will provide a detailed view of the credit usage with charts and tables associated with a prevention message like ‘We recommend you to review your credit consumption or contact SAP for a renewal of your contract’. This allows them to take preventative action or renegotiate their credit contract with SAP.</SPAN></P><P><SPAN>&nbsp;</SPAN></P><H1 id="toc-hId--682777615"><SPAN>Technical Implementation:</SPAN></H1><UL><LI><SPAN>&nbsp;We will deploy a Python-based microservice on SAP BTP Cloud Foundry.</SPAN></LI><LI><SPAN>&nbsp;This microservice will:</SPAN></LI><UL><LI><SPAN>&nbsp;&nbsp;Scrape usage data via the API endpoint.</SPAN></LI><LI><SPAN>&nbsp;&nbsp;Generate time series for analysis.</SPAN></LI><LI><SPAN>&nbsp;&nbsp;&nbsp;Present the data in an easy to understand chart format.</SPAN></LI><LI><SPAN>&nbsp;&nbsp;&nbsp;Provide recommendations based on the usage predictions.</SPAN></LI></UL></UL><P><SPAN>&nbsp;</SPAN></P><H1 id="toc-hId--879291120"><SPAN>Conclusion:</SPAN></H1><P><SPAN>This usage tracker will help BTP customers manage their credit consumption more effectively, avoiding overconsumption and potential cost overruns.</SPAN></P><P><BR /><BR /><BR /></P> 2024-06-26T15:46:55.036000+02:00 https://community.sap.com/t5/technology-q-a/uninstall-sap-cloud-connector/qaq-p/13753526 uninstall sap cloud connector 2024-07-07T19:44:07.231000+02:00 aditinayak27 https://community.sap.com/t5/user/viewprofilepage/user-id/817708 <P>I am unable to uninstall sap cloud connector</P> 2024-07-07T19:44:07.231000+02:00 https://community.sap.com/t5/technology-q-a/is-it-possible-to-restrict-btp-access-by-ip-address/qaq-p/13754902 Is it possible to restrict BTP access by IP Address? 2024-07-09T02:53:58.738000+02:00 SAPSupport https://community.sap.com/t5/user/viewprofilepage/user-id/121003 <P>Dear SAP Team</P><P>we have a requirement to handle SAP BTP Launchpad access in below scenarios</P><P>As BTP Public cloud is internet based application, is there a way to restrict users?<BR /><BR />Scenario is&nbsp;</P><OL><LI>if users are in office with in my Company IP range, then no need MFA authentication, they can directly login</LI><LI>if users are using BTP launchpad remotely, then MFA should kick in. as the IP's they are accessing is out of our company IP Range,</LI></OL><BR />------------------------------------------------------------------------------------------------------------------------------------------------<BR /><B>Learn more about the SAP Support user and program <A target="_blank" href="https://community.sap.com/t5/enterprise-resource-planning-blogs-by-sap/maximizing-the-power-of-sap-community-at-product-support/ba-p/13501276">here</A>.</B> 2024-07-09T02:53:58.738000+02:00 https://community.sap.com/t5/technology-q-a/error-authentication-kind-quot-jwt-quot-configured-but-no-xsuaa-instance/qaq-p/13755384 Error: Authentication kind "jwt" configured, but no XSUAA instance bound to application 2024-07-09T10:39:07.092000+02:00 kaizen9 https://community.sap.com/t5/user/viewprofilepage/user-id/1416327 <P>Hello community,&nbsp;</P><P>I would like to connect <STRONG>CAP Node.js</STRONG> app to external SAP service in production env using <STRONG>destinations</STRONG>. It is important to use <STRONG>OAuth2.0ClientCredentials </STRONG>authentication method. Sandbox works for me. Official document is bit confusing.</P><P>When I run production profile, I am getting below error. Do I need any additional NPM package, or require additional configuration in <STRONG>package.json</STRONG> or elsewhere?</P><P>What to do in order to successfully fetch data from "production" environment?&nbsp; &nbsp; Thank you.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kaizen9_0-1720512753336.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/134201iB7ADFFBC0A3C6619/image-size/medium?v=v2&amp;px=400" role="button" title="kaizen9_0-1720512753336.png" alt="kaizen9_0-1720512753336.png" /></span></P><P><STRONG>package.json</STRONG></P><pre class="lia-code-sample language-json"><code> "cds": { "requires": { "Some_ExternalServiceV4": { "kind": "odata", "model": "srv/external/Some_ExternalServiceV4", "[sandbox]": { "credentials": { "url": "https://sandbox.api.sap.com/sappricing/datafetch" } }, "[production]": { "credentials": { "destination": "datafetch-destination" } } } } }</code></pre><P>&nbsp;</P><P>&nbsp;</P> 2024-07-09T10:39:07.092000+02:00 https://community.sap.com/t5/technology-q-a/sap-application-logging-service/qaq-p/13756456 SAP Application logging service 2024-07-10T08:52:08.496000+02:00 SAP_Application_logging_servic https://community.sap.com/t5/user/viewprofilepage/user-id/1484854 <P>Hi I have successfully deployed SAP Application Logging service in my cloudfoundry dev namespace. I would like to generate Secret Key to the instance. But when I try to create the Secret key the creation of key is failing and the error is as follows.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SAP_Application_logging_servic_0-1720594114520.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/134712iE0C714A127129097/image-size/medium?v=v2&amp;px=400" role="button" title="SAP_Application_logging_servic_0-1720594114520.png" alt="SAP_Application_logging_servic_0-1720594114520.png" /></span></P><P>&nbsp;</P> 2024-07-10T08:52:08.496000+02:00 https://community.sap.com/t5/technology-q-a/xsuaa-api-access-how-to-generate-correct-oauth-token-with-appropriate/qaq-p/13757811 XSUAA API Access - How to generate correct OAuth Token with appropriate scopes 2024-07-11T10:30:12.744000+02:00 SAPSupport https://community.sap.com/t5/user/viewprofilepage/user-id/121003 <P>Hello,</P><P>i want to use the API for "User Management (System for Cross-domain Identity Management (SCIM))" to get all users for a subaccount.</P><P>How to select the current subaccount to get all users from that?</P><P>Currently my OAuth 2.0 scopes were not sufficient.</P><P>Do i need to create a own application for that ?&nbsp;</P><P>How i can test this API with Postman?&nbsp;<BR />Kind regards,</P><BR />------------------------------------------------------------------------------------------------------------------------------------------------<BR /><B>Learn more about the SAP Support user and program <A target="_blank" href="https://community.sap.com/t5/enterprise-resource-planning-blogs-by-sap/maximizing-the-power-of-sap-community-at-product-support/ba-p/13501276">here</A>.</B> 2024-07-11T10:30:12.744000+02:00 https://community.sap.com/t5/technology-q-a/adding-new-members-into-sap-cx-ai-toolkit/qaq-p/13760571 Adding new members into SAP CX AI toolkit 2024-07-15T09:15:49.950000+02:00 pandeysuresh06 https://community.sap.com/t5/user/viewprofilepage/user-id/619584 <P>Hi Team ,</P><P>We have got SAP CX AI toolkit tenant provisioned and our admin has added our users to it but we are not able to login to that tenant.</P><P>Can somebody please help what steps we are missing , adminstrator got a password from SAP to login to tenant but how other users can get password to login or is there any separate process for it.</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P> 2024-07-15T09:15:49.950000+02:00 https://community.sap.com/t5/technology-q-a/routes-cannot-be-mapped-to-destinations-in-different-spaces/qaq-p/13763226 Routes cannot be mapped to destinations in different spaces 2024-07-17T11:44:42.698000+02:00 gilad https://community.sap.com/t5/user/viewprofilepage/user-id/1473970 <P>hi, when working on this tutorial:&nbsp;<A href="https://developers.sap.com/tutorials/cp-cf-security-xsuaa-create.html#96bf4d90-d49d-4e27-8ebe-40b1e2da969a" target="_blank" rel="noopener noreferrer">https://developers.sap.com/tutorials/cp-cf-security-xsuaa-create.html#96bf4d90-d49d-4e27-8ebe-40b1e2da969a</A></P><P>got this error:&nbsp;For application 'product-list': Routes cannot be mapped to destinations in different spaces</P><P>that is when pushing to btp (after being logged-in).</P><P>any idea?</P><P>thanks.</P> 2024-07-17T11:44:42.698000+02:00 https://community.sap.com/t5/technology-q-a/active-directory-and-sap-s-4-integration-via-btp/qaq-p/13764701 Active Directory and SAP S/4 integration via BTP 2024-07-18T13:42:06.907000+02:00 bastorino72 https://community.sap.com/t5/user/viewprofilepage/user-id/459499 <P>Dear all<BR />one of my customer is requesting me the possibility to interface is Active Directory with his SAP S/4. And he wants to create SAP users in a specific group in AC to be created in SAP S/4.<BR />and even deleted or set to end of validity once the user went out of this AD group<BR />there's a BTP service that allows this kind of scenario?</P> 2024-07-18T13:42:06.907000+02:00 https://community.sap.com/t5/technology-q-a/ips-sync-issue-s-4hana-cloud-private-edition-user-and-roles-sync/qaq-p/13765532 IPS Sync Issue : S/4HANA Cloud Private edition User and Roles Sync 2024-07-19T08:11:04.275000+02:00 rayyavu https://community.sap.com/t5/user/viewprofilepage/user-id/43619 <P>Hello Team,&nbsp;</P><P>We're trying to sync the users and their roles from SAP S/4Hana Cloud, Private Edition to Work Zone (standard) using IPS sync.&nbsp;</P><P>We've followed the below process by referring the help documents.&nbsp;</P><UL><LI><A href="https://help.sap.com/docs/start/sap-start/configure-identity-provisioning-service" target="_blank" rel="noopener noreferrer">Configure the Identity Provisioning Service | SAP Help Portal</A></LI><LI><A href="https://help.sap.com/docs/identity-provisioning/identity-provisioning/sap-application-server-abap" target="_blank" rel="noopener noreferrer">SAP Application Server ABAP | SAP Help Portal</A></LI><LI><A href="https://help.sap.com/docs/joule/integrating-joule-with-sap/configure-identity-provisioning-service-a6cf317ecede4fa78c57be07219cee1a" target="_blank" rel="noopener noreferrer">Configure Identity Provisioning Service | SAP Help Portal</A></LI></UL><P>However, while performing the sync we're getting issue&nbsp;"<STRONG>Initialization of repository destination &lt;destination_name&gt; Failed: No user identity is configured</STRONG>".&nbsp;</P><P>S/4HANA Cloud, Private Edition version : 2022&nbsp;</P><P><STRONG>Steps Followed:&nbsp;</STRONG></P><P>1. Established the cloud connector setup with BTP Subaccount&nbsp;</P><P>2. Subscribed the SAP Identity service, connectivity plan to BTP subaccount based on IAS region</P><P>3. Created a dedicated destination with "RFC" as connection type with cloud connector information and checked the connection&nbsp;</P><P>4. Created Source system with type "SAP Application Server ABAP" and selected the destination (point3).</P><P>5. Created target system with type "SAP Build Work Zone, standard edition"&nbsp;</P><P>6. Performed the Read / Resync action from the Source system.&nbsp;</P><P>&nbsp;</P><P>Thanks.&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P> 2024-07-19T08:11:04.275000+02:00