<?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 Re: Using OAuth2 to retrieve a valid API access token in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-oauth2-to-retrieve-a-valid-api-access-token/m-p/12119551#M1974150</link>
    <description>&lt;P&gt;Hi Tomas,&lt;/P&gt;&lt;P&gt;Yes, I downloaded the certification from all levels and loaded into STRUST SSL_server_standard. I also tried as Anonymous, by passing ssl_id = 'ANONYM' after loading in strust SSL client SSL Client (Anonymous) and I got same error. I am reading now around OAUTH to see if that works, but so far no luck&lt;/P&gt;</description>
    <pubDate>Sun, 31 Jan 2021 15:26:38 GMT</pubDate>
    <dc:creator>former_member322405</dc:creator>
    <dc:date>2021-01-31T15:26:38Z</dc:date>
    <item>
      <title>Using OAuth2 to retrieve a valid API access token</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-oauth2-to-retrieve-a-valid-api-access-token/m-p/12119540#M1974139</link>
      <description>&lt;P&gt;Hello Experts,&lt;/P&gt;
  &lt;P&gt;We have an existing report which sends our data to external through Restful request. In which the static API-key for API authentication is used. Now we have to replace this Authentication process with OAuth2 client credential flow. &lt;/P&gt;
  &lt;P&gt;Please assist me the class/method used or any sample code for obtaining and handling the access tokens. I have gone through the SAP documents but not clear about the class/methods to be used. Also kindly let me know if any configurations required to be done. If any, then how to check if the configuration already exists in the system or not.&lt;/P&gt;
  &lt;P&gt;Thanks and Regards,&lt;/P&gt;
  &lt;P&gt;Arunagiri.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Dec 2019 07:33:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-oauth2-to-retrieve-a-valid-api-access-token/m-p/12119540#M1974139</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2019-12-18T07:33:45Z</dc:date>
    </item>
    <item>
      <title>Re: Using OAuth2 to retrieve a valid API access token</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-oauth2-to-retrieve-a-valid-api-access-token/m-p/12119541#M1974140</link>
      <description>&lt;P&gt;I had same problem and ended up doing it manually (developed it myself). I could not make the "OAuth 2.0 Client for AS ABAP" work. By the way I think there is some OAuth 2.0 support in SAP PI if you have it you can try it.&lt;/P&gt;&lt;P&gt;Manual (program) steps like this:&lt;/P&gt;&lt;UL&gt;
&lt;LI&gt;First HTTP call to retreive OAuth 2.0 token (save token + its valid period). In future token calls I am checking if it is still valid and either use valid one or do HTTP call to get a new one.&lt;/LI&gt;&lt;LI&gt;Second HTTP call is your REST request, where you put token in the HTTP header field. Similar like your static API-key.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;EDIT: you might need more calls then just one "get token", depending on how is the third party implementing the OAuth flow.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Dec 2019 09:05:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-oauth2-to-retrieve-a-valid-api-access-token/m-p/12119541#M1974140</guid>
      <dc:creator>Tomas_Buryanek</dc:creator>
      <dc:date>2019-12-18T09:05:54Z</dc:date>
    </item>
    <item>
      <title>Re: Using OAuth2 to retrieve a valid API access token</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-oauth2-to-retrieve-a-valid-api-access-token/m-p/12119542#M1974141</link>
      <description>&lt;P&gt;Hi Tomas,&lt;/P&gt;&lt;P&gt;Could you please elaborate the manual step which you have used in your scenario?&lt;/P&gt;&lt;P&gt;In the First HTTP call - Which class/method is used to retrieve the OAuth2 token? as we need to pass the client_id, client_secret and grant_type to fetch the token.&lt;/P&gt;&lt;P&gt;Thanks and Regards,&lt;/P&gt;&lt;P&gt;Arunagiri.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Dec 2019 09:32:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-oauth2-to-retrieve-a-valid-api-access-token/m-p/12119542#M1974141</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2019-12-18T09:32:44Z</dc:date>
    </item>
    <item>
      <title>Re: Using OAuth2 to retrieve a valid API access token</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-oauth2-to-retrieve-a-valid-api-access-token/m-p/12119543#M1974142</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;which class/method are you using for your current rest request? I used cl_http_client class. &lt;BR /&gt;Passing grant_type + authorization example:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;lo_http-&amp;gt;request-&amp;gt;set_form_field(&lt;BR /&gt;   EXPORTING name  = 'grant_type'&lt;BR /&gt;             value = 'xyz' ). "your grant_type

lo_http-&amp;gt;request-&amp;gt;set_header_field(&lt;BR /&gt;   EXPORTING name  = 'Authorization'&lt;BR /&gt;             value = 'xyz' ). "your authorization (probably "Basic" + Base64 client id+secret value)&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 18 Dec 2019 09:46:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-oauth2-to-retrieve-a-valid-api-access-token/m-p/12119543#M1974142</guid>
      <dc:creator>Tomas_Buryanek</dc:creator>
      <dc:date>2019-12-18T09:46:19Z</dc:date>
    </item>
    <item>
      <title>Re: Using OAuth2 to retrieve a valid API access token</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-oauth2-to-retrieve-a-valid-api-access-token/m-p/12119544#M1974143</link>
      <description>&lt;P&gt;Hi Tomas,&lt;/P&gt;&lt;P&gt;We are using the same Cl_http_client. &lt;/P&gt;&lt;P&gt;I will refer your code but where do we receive the OAuth2 Token after we set the credentials/grant type using the lo_http-&amp;gt;request-&amp;gt;set_form_field().&lt;/P&gt;&lt;P&gt;So as per your logic:&lt;/P&gt;&lt;P&gt;First HTTP Call: &lt;/P&gt;&lt;P&gt;http_client-&amp;gt;request-&amp;gt;set_form_fields( fields = lt_credential multivalue = lv_value ).&lt;/P&gt;&lt;P&gt;lt_credential will have the client_id and grant_type. &lt;/P&gt;&lt;P&gt;Second HTTP call:&lt;/P&gt;&lt;P&gt;we have to pass the access token in the below method?&lt;/P&gt;&lt;P&gt;http_client-&amp;gt;request-&amp;gt;set_header_field( name  = 'Authorization' value = Access-token ). &lt;/P&gt;&lt;P&gt;Please make me clear.&lt;/P&gt;&lt;P&gt;Thanks and Regards,&lt;/P&gt;&lt;P&gt;Arunagiri.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Dec 2019 10:29:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-oauth2-to-retrieve-a-valid-api-access-token/m-p/12119544#M1974143</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2019-12-18T10:29:00Z</dc:date>
    </item>
    <item>
      <title>Re: Using OAuth2 to retrieve a valid API access token</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-oauth2-to-retrieve-a-valid-api-access-token/m-p/12119545#M1974144</link>
      <description>&lt;P&gt;No you got it wrong. set_form_fields or set_header_field is not HTTP call.&lt;/P&gt;&lt;P&gt;I suggest you to study a little bit about basics of HTTP communication (request method, header fields, form fields, request body, response body, response header fields...) - when you will understand these things, then you will be ready to work with cl_http_client which is straightforward about this.&lt;/P&gt;&lt;P&gt;Also it is good to first try any kind of HTTP requests in POSTman or some similar HTTP client. And then when you make it work you can replicate it in ABAP.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Dec 2019 10:52:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-oauth2-to-retrieve-a-valid-api-access-token/m-p/12119545#M1974144</guid>
      <dc:creator>Tomas_Buryanek</dc:creator>
      <dc:date>2019-12-18T10:52:43Z</dc:date>
    </item>
    <item>
      <title>Re: Using OAuth2 to retrieve a valid API access token</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-oauth2-to-retrieve-a-valid-api-access-token/m-p/12119546#M1974145</link>
      <description>&lt;P&gt;Please use the COMMENT button for comments, questions, adding details, etc., ANSWER is only to propose a solution, dixit SAP text at the right of the answer area. At the same time, the person will be informed of your comment (currently not).&lt;/P&gt;</description>
      <pubDate>Wed, 18 Dec 2019 12:29:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-oauth2-to-retrieve-a-valid-api-access-token/m-p/12119546#M1974145</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2019-12-18T12:29:47Z</dc:date>
    </item>
    <item>
      <title>Re: Using OAuth2 to retrieve a valid API access token</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-oauth2-to-retrieve-a-valid-api-access-token/m-p/12119547#M1974146</link>
      <description>&lt;P&gt;Hi &lt;SPAN class="mention-scrubbed"&gt;arunagiri.a&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Is your issue solved?&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jul 2020 09:46:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-oauth2-to-retrieve-a-valid-api-access-token/m-p/12119547#M1974146</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2020-07-13T09:46:08Z</dc:date>
    </item>
    <item>
      <title>Re: Using OAuth2 to retrieve a valid API access token</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-oauth2-to-retrieve-a-valid-api-access-token/m-p/12119548#M1974147</link>
      <description>&lt;P&gt;Hi &lt;SPAN class="mention-scrubbed"&gt;arunagiri.a&lt;/SPAN&gt;,&lt;/P&gt;&lt;P&gt;I am trying to generate a access token to upload data to the cloud. Can you please help me by providing the steps to generate the oauth token using abap code. &lt;/P&gt;&lt;P&gt;thanks in advance&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2021 07:27:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-oauth2-to-retrieve-a-valid-api-access-token/m-p/12119548#M1974147</guid>
      <dc:creator>maheshboby63</dc:creator>
      <dc:date>2021-01-20T07:27:11Z</dc:date>
    </item>
    <item>
      <title>Re: Using OAuth2 to retrieve a valid API access token</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-oauth2-to-retrieve-a-valid-api-access-token/m-p/12119549#M1974148</link>
      <description>&lt;P&gt;Hi, I tried to use set_form_field and I also added the certifications to strust, but I am getting error code 407, SSL handshake with authentication xxxxxxxxx SSSLERR_NO_SSL_RESPONSE (-75)#Server did not respond with SSL/TLS protocol. I tested same call in postman and it did work. Please let me know if you have any recommendations on areas I should look next.&lt;/P&gt;&lt;P&gt;Regards, Marta&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2021 02:07:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-oauth2-to-retrieve-a-valid-api-access-token/m-p/12119549#M1974148</guid>
      <dc:creator>former_member322405</dc:creator>
      <dc:date>2021-01-26T02:07:10Z</dc:date>
    </item>
    <item>
      <title>Re: Using OAuth2 to retrieve a valid API access token</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-oauth2-to-retrieve-a-valid-api-access-token/m-p/12119550#M1974149</link>
      <description>&lt;P&gt;&lt;SPAN class="mention-scrubbed"&gt;marta.miyazaki2&lt;/SPAN&gt; are you 100% sure that you have used correct SSL certificate?&lt;BR /&gt;(be careful if your company/VPN is using any king of proxy or something, which can alter the SSL)&lt;BR /&gt;Also check where exactly did you placed the certificate in the STRUST. There are multiple clients (folders) and maybe you use different client in your HTTP call.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2021 14:59:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-oauth2-to-retrieve-a-valid-api-access-token/m-p/12119550#M1974149</guid>
      <dc:creator>Tomas_Buryanek</dc:creator>
      <dc:date>2021-01-26T14:59:30Z</dc:date>
    </item>
    <item>
      <title>Re: Using OAuth2 to retrieve a valid API access token</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-oauth2-to-retrieve-a-valid-api-access-token/m-p/12119551#M1974150</link>
      <description>&lt;P&gt;Hi Tomas,&lt;/P&gt;&lt;P&gt;Yes, I downloaded the certification from all levels and loaded into STRUST SSL_server_standard. I also tried as Anonymous, by passing ssl_id = 'ANONYM' after loading in strust SSL client SSL Client (Anonymous) and I got same error. I am reading now around OAUTH to see if that works, but so far no luck&lt;/P&gt;</description>
      <pubDate>Sun, 31 Jan 2021 15:26:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-oauth2-to-retrieve-a-valid-api-access-token/m-p/12119551#M1974150</guid>
      <dc:creator>former_member322405</dc:creator>
      <dc:date>2021-01-31T15:26:38Z</dc:date>
    </item>
  </channel>
</rss>

