<?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: trying to get role collection data from cloud foundry using API using sapui5 from SAP BAS. in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/trying-to-get-role-collection-data-from-cloud-foundry-using-api-using/qaa-p/12572878#M4714499</link>
    <description>&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;from my understanding, your question is how to avoid the CORS error?&lt;BR /&gt;I'm not familiar with Ui5, but I guess the answer is to use your approuter.&lt;BR /&gt;In your ui5 controller you would use a relative URI that points to a route.&lt;BR /&gt;The route then points to a destination which contains the full URL, or base URL.&lt;BR /&gt;I think you already prepared the xsapp.json and destination, now you just need to use them&lt;/P&gt;&lt;P&gt;Kind Regards, &lt;BR /&gt;Carlos&lt;/P&gt;</description>
    <pubDate>Thu, 18 Aug 2022 14:59:43 GMT</pubDate>
    <dc:creator>CarlosRoggan</dc:creator>
    <dc:date>2022-08-18T14:59:43Z</dc:date>
    <item>
      <title>trying to get role collection data from cloud foundry using API using sapui5 from SAP BAS.</title>
      <link>https://community.sap.com/t5/technology-q-a/trying-to-get-role-collection-data-from-cloud-foundry-using-api-using/qaq-p/12572877</link>
      <description>&lt;P&gt;Hi experts,&lt;/P&gt;
  &lt;P&gt;I'm trying to get role collection data of my SAP BTP cloud foundry using the REST API from API Business Hub using SAPUI5 in SAP BAS. Can you all please look at below scenario and help if I am missing out something.&lt;/P&gt;
  &lt;P&gt;Using this API "https://api.sap.com/api/AuthorizationAPI/overview" for role collection details. And this &lt;A href="https://api.sap.com/api/AuthorizationAPI/overview"&gt;API&lt;/A&gt; is of type REST not ODATA.&lt;/P&gt;
  &lt;P&gt;I have done the REST(ajax) call in SAPUI5 using Business Application Studio getting ERROR: CORS Policy.&lt;/P&gt;
  &lt;P&gt;Requirement is to get Role Collections details of my cloud foundry account in SAP BTP from rest &lt;A href="https://api.sap.com/api/AuthorizationAPI/resource"&gt;API&lt;/A&gt; using SAPUI5 in SAP BAS, then use the data to control the Role Collections of SAP BTP CF from custom SAPUI5 app.&lt;/P&gt;
  &lt;P&gt;Tried using destination: &lt;A href="https://answers.sap.com/storage/temp/2086666-apiuaa.txt" data-attachment="2086666"&gt;apiuaa.txt&lt;/A&gt;&lt;/P&gt;
  &lt;P&gt;part of controller where I did the ajax call: &lt;A href="https://answers.sap.com/storage/temp/2086665-controller-part.txt" data-attachment="2086665"&gt;controller-part.txt&lt;/A&gt;&lt;/P&gt;
  &lt;P&gt;ui5.yaml file: &lt;A href="https://answers.sap.com/storage/temp/2086667-ui5yaml.txt" data-attachment="2086667"&gt;ui5yaml.txt&lt;/A&gt;&lt;/P&gt;
  &lt;P&gt;ui5-local.yaml file: &lt;A href="https://answers.sap.com/storage/temp/2086668-ui5-localyaml.txt" data-attachment="2086668"&gt;ui5-localyaml.txt&lt;/A&gt;&lt;/P&gt;
  &lt;P&gt;mta.yaml file: &lt;A href="https://answers.sap.com/storage/temp/2086669-mtayaml.txt" data-attachment="2086669"&gt;mtayaml.txt&lt;/A&gt;&lt;/P&gt;
  &lt;P&gt;xs-app.json file: &lt;A href="https://answers.sap.com/storage/temp/2086671-xs-appjson.txt" data-attachment="2086671"&gt;xs-appjson.txt&lt;/A&gt;&lt;/P&gt;
  &lt;P&gt;Regards,&lt;/P&gt;
  &lt;P&gt;Sagar Singh&lt;/P&gt;</description>
      <pubDate>Thu, 18 Aug 2022 14:07:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/trying-to-get-role-collection-data-from-cloud-foundry-using-api-using/qaq-p/12572877</guid>
      <dc:creator>sagarsingh2000</dc:creator>
      <dc:date>2022-08-18T14:07:51Z</dc:date>
    </item>
    <item>
      <title>Re: trying to get role collection data from cloud foundry using API using sapui5 from SAP BAS.</title>
      <link>https://community.sap.com/t5/technology-q-a/trying-to-get-role-collection-data-from-cloud-foundry-using-api-using/qaa-p/12572878#M4714499</link>
      <description>&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;from my understanding, your question is how to avoid the CORS error?&lt;BR /&gt;I'm not familiar with Ui5, but I guess the answer is to use your approuter.&lt;BR /&gt;In your ui5 controller you would use a relative URI that points to a route.&lt;BR /&gt;The route then points to a destination which contains the full URL, or base URL.&lt;BR /&gt;I think you already prepared the xsapp.json and destination, now you just need to use them&lt;/P&gt;&lt;P&gt;Kind Regards, &lt;BR /&gt;Carlos&lt;/P&gt;</description>
      <pubDate>Thu, 18 Aug 2022 14:59:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/trying-to-get-role-collection-data-from-cloud-foundry-using-api-using/qaa-p/12572878#M4714499</guid>
      <dc:creator>CarlosRoggan</dc:creator>
      <dc:date>2022-08-18T14:59:43Z</dc:date>
    </item>
    <item>
      <title>Re: trying to get role collection data from cloud foundry using API using sapui5 from SAP BAS.</title>
      <link>https://community.sap.com/t5/technology-q-a/trying-to-get-role-collection-data-from-cloud-foundry-using-api-using/qaa-p/12572879#M4714500</link>
      <description>&lt;P&gt;Hey!&lt;/P&gt;&lt;P&gt;Carlos already did point out the correct approach. Just wanted to share with you: I am doing the same way, attaching a "beforeRequestHandler" on the approuter, before starting. With this approach I am adding a "getuserinfo" route to the approuter, because the default one does not provide the scopes of the user.&lt;/P&gt;&lt;P&gt;Within this approach, we can fetch the user-scopes and disable buttons, elements, whatever (btw: this is just an optical thing, of course the backend is also checking before executing something. So do not use this to actually protect something, because you can edit it on the browser site).&lt;/P&gt;</description>
      <pubDate>Fri, 26 Aug 2022 07:04:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/trying-to-get-role-collection-data-from-cloud-foundry-using-api-using/qaa-p/12572879#M4714500</guid>
      <dc:creator>dr_vup</dc:creator>
      <dc:date>2022-08-26T07:04:27Z</dc:date>
    </item>
  </channel>
</rss>

