Highlighted
maqsood Valued Contributor.
Valued Contributor.
97 views

NetIQ REST Driver how get header value of a Query (Http get)?

NetIQ REST driver

IDM 4.7.2 AE

 

We have very strange API (SAP C4S, Cloud for service) which requires special header "X-CSRF-Token" and value with subsequent Post and Patch operations after http Get.

 

This special header and its value  is returned with any http "Get" operation to API, 

I am able to do Query http GET from the driver, but how to capture "header" value returned by REST shim in the driver policy?

 

Regards

Maqsood.

Labels (1)
4 Replies
Knowledge Partner
Knowledge Partner

Re: NetIQ REST Driver how get header value of a Query (Http get)?

I think Headers are supposed to be returned in the <driver-operation-data> right?  I recall on a SOAP shim I needed the returned headers and the shim did not return it.  But I thought they fixed that in the REST Shim.

Any trace examples to show it happening?

0 Likes
maqsood Valued Contributor.
Valued Contributor.

Re: NetIQ REST Driver how get header value of a Query (Http get)?

Hello  geoffc

 

This is how the trace looks like from shim: Query and Response.

DirXML: [08/12/19 16:56:35.35]: TRACE: Remote Loader: Received command: SUBSCRIBER EXECUTE(4).
DirXML: [08/12/19 16:56:35.35]: TRACE: Remote Loader: Calling SubscriptionShim.execute()
DirXML: [08/12/19 16:56:35.36]: TRACE:
<source>
<product edition="Advanced" version="4.7.2.0">DirXML</product>
<contact>NetIQ Corporation</contact>
</source>
<input>
<driver-operation-data class-name="EmployeeCollection" command="query" event-id="0">

<value>{}</value>
</request>
</driver-operation-data>
</input>
</nds>
DirXML: [08/12/19 16:56:35.36]: TRACE: C4S-Employee-Dev: sub-execute
DirXML: [08/12/19 16:56:35.36]: TRACE: C4S-Employee-Dev: queryHandler
DirXML: [08/12/19 16:56:35.36]: TRACE: C4S-Employee-Dev: queryHandler: class-name == 'EmployeeCollection'
DirXML: [08/12/19 16:56:35.36]: TRACE: C4S-Employee-Dev: Query: preparing GET to https://myxxxxxxx.crm.ondemand.com/sap/c4c/odata/v1/c4codataapi/EmployeeCollection?$filter=EmployeeID
DirXML: [08/12/19 16:56:35.36]: TRACE: C4S-Employee-Dev: Resetting headers
DirXML: [08/12/19 16:56:35.36]: TRACE: C4S-Employee-Dev: Setting the following HTTP request properties:
Authorization:
DirXML: [08/12/19 16:56:35.36]: TRACE: C4S-Employee-Dev: content-type:application/json
DirXML: [08/12/19 16:56:35.36]: TRACE: C4S-Employee-Dev: accept:application/json
DirXML: [08/12/19 16:56:35.36]: TRACE: C4S-Employee-Dev: X-CSRF-Token:fetch
DirXML: [08/12/19 16:56:36.62]: TRACE: C4S-Employee-Dev: Did a HTTP GET with 0 bytes of data to https://myxxxxxx.crm.ondemand.com/sap/c4c/odata/v1/c4codataapi/EmployeeCollection?$filter=EmployeeID
DirXML: [08/12/19 16:56:37.96]: TRACE: C4S-Employee-Dev: Response code and message: 200 OK
DirXML: [08/12/19 16:56:37.96]: TRACE: Remote Loader: SubscriptionShim.execute() returned:
DirXML: [08/12/19 16:56:37.96]: TRACE:
<source>
<product build="20180222_0635" version="1.0.0.2">Identity Manager REST Driver</product>
<contact>NetIQ Corporation.</contact>
</source>
<output>
<status event-id="0" level="success" type="driver-general">
<driver-operation-data class-name="EmployeeCollection" command="query" dest-dn="" event-id="0">

{"d":{"results":[{"__metadata":{"uri":"https://myxxxxxx.crm.ondemand.com/sap/c4c/odata/v1/c4codataapi/EmployeeCollection('GUID')","type":"c4codata.Employee","etag":"W/\"datetimeoffset'2019-08-12T13438","}
</response>
</driver-operation-data>
</status>
</output>
</nds>

 

Looks like shim strips away the received headers from the responses from API.

Regards,

Maqsood.

 

0 Likes
Knowledge Partner
Knowledge Partner

Re: NetIQ REST Driver how get header value of a Query (Http get)?

Well that is not helpful. I wonder if you could do a Java extension to catch those...

 

0 Likes
maqsood Valued Contributor.
Valued Contributor.

Re: NetIQ REST Driver how get header value of a Query (Http get)?

Do you know can i use SOAP driver without writing java extensions to get htttp headers in the policy?

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.