Skip to Content
0
Jan 11, 2019 at 08:36 AM

Passing Dynamic Oauth Token & API Key in Header of Sender REST Adapter

6893 Views Last edit Feb 04, 2019 at 03:13 PM 2 rev

Hi All,

I'm configuring sender REST Pooling to consume Ariba API. I'm passing two value 1st temporary oauth token and 2nd API Key in header filed, it's working fine. API Key is constant but token is getting expire in every 27 minutes.

I have written java code to fetch token dynamically and passing it in DynamicConfiguration, but don't know where to put access_token variable in REST Adapter.

DynamicConfiguration conf = input.getDynamicConfiguration(); DynamicConfigurationKey keyHeader1 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System", "HeaderFieldOne"); conf.put(keyHeader1, "Bearer "+access_token);

Please guide me with two thing

1. Java mapping code to generate token (i have written, but need sample code to understand better)

2. How to configure token variable in sender REST adapter.

ADAPTER CONFIGURATION:-

When i select REST in Message Protocol, XI Dynamic Attribute is coming but HTTP Header tab is not there, where i will mention

Authorization Bearer {access_token}?

Appreciate your time,

Binod Kumar

Attachments

1.png (16.2 kB)
2.png (23.3 kB)
3.png (17.6 kB)