REST Driver - ARIBA - How to add the user in the REST call

Hello, team.


I'm currently creating a REST driver to connect with SAP-ARIBA. 

AS per the swagger that ARIBA team shared with me, I should use something similar to:

I have configured the Resource on the DriverParameters / Subscriber option but I'm not sure how to pass the User and Password to the header as requested by Ariba team.

Swagger Method: saparibaURL/qualifications?realm=s4All&user=Super User&passwordAdapter=PasswordAdapter1

Does anyone have created rest driver to SAP Ariba? Or do you know to pass the user CN to the Header?


Thanks

Diego 

  • Verified Answer

    This part is technically there in the docs, but really should be much more in your face and obvious, since after I write this and you go back and re-read the docs you will say "Oh I get it now".  The goal of the docs should be to get there first read.  It is tricky.

    Basically on the Sub channel, driver configuration, driver properties (I did that backwards, but you know what I mean) there are "Resources" defined.

    When you define a URL for them, you are allowed to stick in 'tokens' delimited inside <> (angle brackets/less-than/greater-than signs).

    So you would be allowed to set the URL in the IDM config as:

    saparibaURL/qualifications?realm=s4All&user=<username>&passwordAdapter=<password1>

    So obvious question is, where does the info for username and password1 come from? This is the part I wish was clearer in the docs..

    Basically the REST driver does not take <add> or <modify> events per se, instead it expects a policy to transform the XDS to:

        <driver-operation-data command="add" class-name="User">
          <request method="POST" url="https://sapURL/restapi/oauth/token">
            <header Accept="application/json" content-type="application/x-www-form-urlencoded"/>
            <url-token username="MyUserNames" password1="mypassword"/>
            <value>Post Data</value>
          </request>
        </driver-operation-data>

    So in any XML attribute, in the <url-token> node, are available to be pushed into the URL in the Resource configuration.

    Thus, you need to have a policy, that converts your events to driver op data, and along the way you need to add this data into the event.