Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Make OAuth2 calls from ABAP to Autodesk Forge

yasser_aoujil
Explorer
0 Likes
1,339

Hi experts,

I am new to the OAuth2 and Autodesk Forge API.

I am starting to learn about how to integrate both, for now I am stuck on how to make an http post from ABAP code to the authentication endpoint of the Forge API to get the access token. I started looking at this link https://wiki.scn.sap.com/wiki/display/Security/OAuth+2.0+-+Integrating+access+protected+web+services... but I can't get the whole picture if that's what I really need.

Specifically I need help on how can I do the equivalent of the following call using curl (as it come in this link https://developer.autodesk.com/en/docs/oauth/v2/tutorials/get-2-legged-token/):

curl -v 'https://developer.api.autodesk.com/authentication/v1/authenticate'
  -X 'POST'
  -H 'Content-Type: application/x-www-form-urlencoded'
  -d '
    client_id=obQDn8P0GanGFQha4ngKKVWcxwyvFAGE&
    client_secret=eUruM8HRyc7BAQ1e&
    grant_type=client_credentials&
    scope=data:read

Spaces in the call are put for readability purpose.

Any help or insights are appreciated.

2 REPLIES 2
Read only

0 Likes
1,024

First you need to retrieve a IF_HTTP_CLIENT-Instance with the factory-methods in the class CL_HTTP_CLIENT.

With this instance you create an instance of class CL_REST_HTTP_CLIENT and set the request-body in method IF_REST_RESOURCE~POST

Read only

Tomas_Buryanek
Product and Topic Expert
Product and Topic Expert
0 Likes
1,024

EDIT: johannes_gerbershagen11 it is year old question...

-- Tomas --