Hello HCP devs,
we try to push some messages from ABAP to HCP IoT MMS.
What we did:
- Import hanatrial.ondemand.com server certificate as ANONYM SSL client certificate in STRUST
- Create a SM59 type G destination pointing to host iotmmssXXXXXXXXXtrial.hanatrial.ondemand.com:443
SSL active, certificate ANONYM
Authentication: Basic with User=S-User and Password=valid S-User password
http version = 1.1
- Instanciate a CL_HTTP_CLIENT by destination
- put a CL_REST_HTTP_CLIENT on top
- set CL_HTTP_CLIENT properties to LOGON_POPUP=disabled, ACCEPT_COOKIE=enabled, redirect=enable
- Create a valid JSON message with "sync", ... , message id, device id, values
- do a CL_REST_HTTP->POST it to uri=path+DeviceID of the DMS device management
- we get a HTML from HCP "Access to the requested resource is not authorized (HTTP 401)"
This is somehow logic because we need (as it is documented in the Java examples) to provide the unique "Bearer OAuth token" as Authorization header but that collides with the basic authentification before.
Any ideas how the ABAP sequence of authentication look like. We checked the OAuth principle docs but how we should map that on ABAP calls ?
Thanks in advance,