<?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: How to authenticate Cloud Platform API in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/how-to-authenticate-cloud-platform-api/qaa-p/12207420#M4568048</link>
    <description>&lt;P&gt;With the help of SAP:&lt;/P&gt;&lt;P&gt;The CF Cloud Controller API is currently not connected to XSUAA and thus it is not possible to obtain a token from there. Instead you have to directly call the CF UAA service and use a valid user (no service key) and the following parameters. You should then get a valid token with &lt;EM&gt;cloud_controller.read &lt;/EM&gt;and&lt;EM&gt; cloud_controller.write&lt;/EM&gt; scopes.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Endpoint&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://login.cf.eu20.hana.ondemand.com/oauth/token" target="test_blank"&gt;https://login.cf.eu20.hana.ondemand.com/oauth/token&lt;/A&gt; (BTP region dependent)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Basic Authentication&lt;/STRONG&gt;&lt;BR /&gt;user: cf&lt;BR /&gt;password:  (empty - no password)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Parameters:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;username: &amp;lt;BTP user email&amp;gt;&lt;BR /&gt;password: &amp;lt;BTP user password&amp;gt;&lt;BR /&gt;client_id: cf&lt;BR /&gt;grant_type: password&lt;BR /&gt;response_type: token&lt;/P&gt;&lt;P&gt;An example CURL call:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;curl -v -XPOST -H"Application/json" -u "cf:" --data "username=&amp;lt;BTP user email&amp;gt;&amp;amp;password=&amp;lt;myPassword&amp;gt;&amp;amp;client_id=cf&amp;amp;grant_type=password&amp;amp;response_type=token" &lt;A href="https://login.cf.eu20.hana.ondemand.com/oauth/token" target="test_blank"&gt;https://login.cf.eu20.hana.ondemand.com/oauth/token&lt;/A&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 11 Jan 2022 12:25:04 GMT</pubDate>
    <dc:creator>mike_zaschka</dc:creator>
    <dc:date>2022-01-11T12:25:04Z</dc:date>
    <item>
      <title>How to authenticate Cloud Platform API</title>
      <link>https://community.sap.com/t5/technology-q-a/how-to-authenticate-cloud-platform-api/qaq-p/12207412</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
  &lt;P&gt;we want to use the cloud foundry platform api (&lt;A href="http://v3-apidocs.cloudfoundry.org/version/3.81.0/index.html"&gt;http://v3-apidocs.cloudfoundry.org/version/3.81.0/index.html&lt;/A&gt;) to do some automation.&lt;/P&gt;
  &lt;P&gt;The API is OAuth2 protected. In order to authenticate, we would need to create an oauth client and use the credentials to get a token. &lt;STRONG&gt;We did not find any way to do that.&lt;/STRONG&gt; &lt;/P&gt;
  &lt;P&gt;How can we access the api?&lt;/P&gt;
  &lt;P&gt;There is one way for testing we found, as according to the cloud foundry documentation you can get an oauth token with the CLI command "cf oauth-token". That is the only way we found to actually being able to call the api, but this is only ok for some quick testing, but for a live scenario we need a REST way to get a token.&lt;/P&gt;
  &lt;P&gt;Cloud Foundry documentation describes some way to create a client, but this does not work on SAP Cloud Foundry, as we don't have access to tools and infrastructure.&lt;/P&gt;
  &lt;P&gt;Thanks and regards,&lt;/P&gt;
  &lt;P&gt;Tobias&lt;/P&gt;</description>
      <pubDate>Tue, 17 Mar 2020 06:52:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/how-to-authenticate-cloud-platform-api/qaq-p/12207412</guid>
      <dc:creator>tobias_mitter2</dc:creator>
      <dc:date>2020-03-17T06:52:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to authenticate Cloud Platform API</title>
      <link>https://community.sap.com/t5/technology-q-a/how-to-authenticate-cloud-platform-api/qaa-p/12207413#M4568041</link>
      <description>&lt;P&gt;HI Tobias,&lt;/P&gt;&lt;P&gt;maybe you start with a search at api.sap.com with the keywords &lt;A href="https://api.sap.com/search?searchterm=cloud%20foundry&amp;amp;tab=all"&gt;cloud foundry&lt;/A&gt;. From there you should find more documentation.&lt;/P&gt;&lt;P&gt;Best regards&lt;BR /&gt;Gregor&lt;/P&gt;</description>
      <pubDate>Tue, 17 Mar 2020 14:52:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/how-to-authenticate-cloud-platform-api/qaa-p/12207413#M4568041</guid>
      <dc:creator>gregorw</dc:creator>
      <dc:date>2020-03-17T14:52:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to authenticate Cloud Platform API</title>
      <link>https://community.sap.com/t5/technology-q-a/how-to-authenticate-cloud-platform-api/qaa-p/12207414#M4568042</link>
      <description>&lt;P&gt;Hi Gregor, &lt;/P&gt;&lt;P&gt;thanks but we have searched and tried basically everything. I am on and off this topic for half a year now. There is no documentation from SAP regarding this topic. At the moment I believe I haven't overlooked anything, that's why I finally postet the question here in the hope that we are not the only ones trying to use this api for some analytics and automation and maybe somebody else digged out some info.&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Tobias&lt;/P&gt;</description>
      <pubDate>Mon, 23 Mar 2020 12:20:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/how-to-authenticate-cloud-platform-api/qaa-p/12207414#M4568042</guid>
      <dc:creator>tobias_mitter2</dc:creator>
      <dc:date>2020-03-23T12:20:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to authenticate Cloud Platform API</title>
      <link>https://community.sap.com/t5/technology-q-a/how-to-authenticate-cloud-platform-api/qaa-p/12207415#M4568043</link>
      <description>&lt;P&gt;Hi Tobias,&lt;/P&gt;&lt;P&gt;according to the current &lt;A href="https://help.sap.com/doc/43b304f99a8145809c78f292bfc0bc58/Cloud/en-US/98bf747111574187a7c76f8ced51cfeb.html" target="_blank"&gt;release notes&lt;/A&gt; SAP Cloud Platform is running on Cloud Foundry 12.33.0. Maybe the Cloud Foundry API's are helpful for you:&lt;/P&gt;&lt;P&gt;&lt;A href="https://apidocs.cloudfoundry.org/12.33.0/"&gt;https://apidocs.cloudfoundry.org/12.33.0/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Keep us posted about your progress.&lt;/P&gt;&lt;P&gt;Best regards&lt;BR /&gt;Gregor&lt;/P&gt;</description>
      <pubDate>Mon, 23 Mar 2020 12:55:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/how-to-authenticate-cloud-platform-api/qaa-p/12207415#M4568043</guid>
      <dc:creator>gregorw</dc:creator>
      <dc:date>2020-03-23T12:55:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to authenticate Cloud Platform API</title>
      <link>https://community.sap.com/t5/technology-q-a/how-to-authenticate-cloud-platform-api/qaa-p/12207416#M4568044</link>
      <description>&lt;P&gt;Perhaps you can describe better what "some automation" means in detail. Because there is a way to retrieve the &lt;A href="https://help.sap.com/viewer/65de2977205c403bbc107264b8eccf4b/Cloud/en-US/30ece35bac024ca69de8b16bff79c413.html" target="_blank"&gt;Audit Logs using an API for the Cloud Foundry Environment&lt;/A&gt;. &lt;/P&gt;</description>
      <pubDate>Tue, 24 Mar 2020 08:26:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/how-to-authenticate-cloud-platform-api/qaa-p/12207416#M4568044</guid>
      <dc:creator>gregorw</dc:creator>
      <dc:date>2020-03-24T08:26:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to authenticate Cloud Platform API</title>
      <link>https://community.sap.com/t5/technology-q-a/how-to-authenticate-cloud-platform-api/qaa-p/12207417#M4568045</link>
      <description>&lt;P&gt;So I am going to answer this myself. It seems there is no solution yet, but there is one coming.&lt;/P&gt;&lt;P&gt;See this: &lt;A href="https://help.sap.com/viewer/65de2977205c403bbc107264b8eccf4b/Cloud/en-US/3670474a58c24ac2b082e76cbbd9dc19.html"&gt;https://help.sap.com/viewer/65de2977205c403bbc107264b8eccf4b/Cloud/en-US/3670474a58c24ac2b082e76cbbd9dc19.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Just stumbled over it by accident. When I look at the supported scopes though, it seems it is only a part of the whole api. It doesn't even say which api (v2 or v3), it might even be that SAP is building a facade around it...have to check it out some time. Hope this helps.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Apr 2020 11:25:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/how-to-authenticate-cloud-platform-api/qaa-p/12207417#M4568045</guid>
      <dc:creator>tobias_mitter2</dc:creator>
      <dc:date>2020-04-06T11:25:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to authenticate Cloud Platform API</title>
      <link>https://community.sap.com/t5/technology-q-a/how-to-authenticate-cloud-platform-api/qaa-p/12207418#M4568046</link>
      <description>&lt;P&gt;Hi &lt;SPAN class="mention-scrubbed"&gt;tobias.mitter2&lt;/SPAN&gt;,&lt;/P&gt;&lt;P&gt;did you find a solution in the meantime?&lt;BR /&gt;I am stuck with the same problem. The token obtained from the CLI (cf oauth-token) is working fine to access the Cloud Controller API (v2 and v3), but I am not able to get a valid access-token from any authorization endpoint, including the Cloud Management Service.&lt;/P&gt;&lt;P&gt;Kind Regards,&lt;/P&gt;&lt;P&gt;Mike&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jan 2022 17:06:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/how-to-authenticate-cloud-platform-api/qaa-p/12207418#M4568046</guid>
      <dc:creator>mike_zaschka</dc:creator>
      <dc:date>2022-01-04T17:06:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to authenticate Cloud Platform API</title>
      <link>https://community.sap.com/t5/technology-q-a/how-to-authenticate-cloud-platform-api/qaa-p/12207419#M4568047</link>
      <description>&lt;P&gt;Hello Mike, as we are still not on feature set b, we could not move forward here. Regards, Tobias&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jan 2022 08:04:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/how-to-authenticate-cloud-platform-api/qaa-p/12207419#M4568047</guid>
      <dc:creator>tobias_mitter2</dc:creator>
      <dc:date>2022-01-05T08:04:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to authenticate Cloud Platform API</title>
      <link>https://community.sap.com/t5/technology-q-a/how-to-authenticate-cloud-platform-api/qaa-p/12207420#M4568048</link>
      <description>&lt;P&gt;With the help of SAP:&lt;/P&gt;&lt;P&gt;The CF Cloud Controller API is currently not connected to XSUAA and thus it is not possible to obtain a token from there. Instead you have to directly call the CF UAA service and use a valid user (no service key) and the following parameters. You should then get a valid token with &lt;EM&gt;cloud_controller.read &lt;/EM&gt;and&lt;EM&gt; cloud_controller.write&lt;/EM&gt; scopes.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Endpoint&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://login.cf.eu20.hana.ondemand.com/oauth/token" target="test_blank"&gt;https://login.cf.eu20.hana.ondemand.com/oauth/token&lt;/A&gt; (BTP region dependent)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Basic Authentication&lt;/STRONG&gt;&lt;BR /&gt;user: cf&lt;BR /&gt;password:  (empty - no password)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Parameters:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;username: &amp;lt;BTP user email&amp;gt;&lt;BR /&gt;password: &amp;lt;BTP user password&amp;gt;&lt;BR /&gt;client_id: cf&lt;BR /&gt;grant_type: password&lt;BR /&gt;response_type: token&lt;/P&gt;&lt;P&gt;An example CURL call:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;curl -v -XPOST -H"Application/json" -u "cf:" --data "username=&amp;lt;BTP user email&amp;gt;&amp;amp;password=&amp;lt;myPassword&amp;gt;&amp;amp;client_id=cf&amp;amp;grant_type=password&amp;amp;response_type=token" &lt;A href="https://login.cf.eu20.hana.ondemand.com/oauth/token" target="test_blank"&gt;https://login.cf.eu20.hana.ondemand.com/oauth/token&lt;/A&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 11 Jan 2022 12:25:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/how-to-authenticate-cloud-platform-api/qaa-p/12207420#M4568048</guid>
      <dc:creator>mike_zaschka</dc:creator>
      <dc:date>2022-01-11T12:25:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to authenticate Cloud Platform API</title>
      <link>https://community.sap.com/t5/technology-q-a/how-to-authenticate-cloud-platform-api/qaa-p/12207421#M4568049</link>
      <description>&lt;P&gt;Hello Mike! Could you please inform me about the CF User and where I can locate it? From what I gather, it's distinct from the BTP Cockpit user email. Also, how can I obtain the CF client_id? I'm attempting to execute the CURL example call on CF CLI, but I'm encountering an unauthorized error. Thanks for your assistance!&lt;/P&gt;</description>
      <pubDate>Thu, 21 Sep 2023 13:39:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/how-to-authenticate-cloud-platform-api/qaa-p/12207421#M4568049</guid>
      <dc:creator>danfqa</dc:creator>
      <dc:date>2023-09-21T13:39:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to authenticate Cloud Platform API</title>
      <link>https://community.sap.com/t5/technology-q-a/how-to-authenticate-cloud-platform-api/qaa-p/13981296#M4898452</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.sap.com/t5/user/viewprofilepage/user-id/144369"&gt;@mike_zaschka&lt;/a&gt;,&lt;BR /&gt;hi all &amp;nbsp;and a Happy New Year 2025!&lt;/P&gt;&lt;P&gt;We have been struggling with this topic, as well, with some “sleepless nights” and accidentally found this community post and we are very happy to say, that you have provided this information to us – thanks.&lt;/P&gt;&lt;P&gt;Now, with providing a valid user, configured in the BTP (email / password) we have managed to get valid access-tokens.&lt;/P&gt;&lt;P&gt;Because your answer here is 3 years old, maybe you (or some one else here) can give information, if accessing the Cloud Foundry can be managed differently. If we rely on this approach, this would mean, we would need some kind of a technical user on the BTP platform and from security perspective, can we some avoid providing passwords in plain text?&lt;/P&gt;&lt;P&gt;Thanks a lot in advance,&lt;/P&gt;&lt;P&gt;M.Spyker&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2025 08:50:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/how-to-authenticate-cloud-platform-api/qaa-p/13981296#M4898452</guid>
      <dc:creator>marco_spyker</dc:creator>
      <dc:date>2025-01-09T08:50:22Z</dc:date>
    </item>
  </channel>
</rss>

