on 01-18-2018 12:03 PM - last edited on 02-04-2024 2:45 AM by postmig_api_4
I have a RaspberryPi running Node-RED. I currently have a threshold workflow deployed that reacts to specific sensor values. My question: How can I configure my client to send IoT AE Events via the REST API into my cloud instance?
I do know the syntax of the REST API to create and read events as well as the endpoint. I am able to use Postman for this job. However, the authentification using one's own client is different.
I read the Authorization Guide at the bottom of https://www.sap.com/developer/topics/iot-application-enablement.resources.html#resources .
I also took a look at the SCP Security help page https://help.sap.com/viewer/65de2977205c403bbc107264b8eccf4b/Cloud/en-US/e129aa20c78c4a9fb379b9803b0...
Unfortunately, I still don't grasp the concept fully. I assume that I have to incorporate OAuth2.0 into my REST client when sending the message. But how do I that? How do I get the necessary token?
Many thanks in advance and best regards,
Frederik
The second option described here https://blogs.sap.com/2017/10/13/access-the-sap-iot-application-enablement-apis-using-postman/ gives more details on fabian's suggestion and this works from anyplace in the Internet. You need the client secret your admin received when the tenant was provided by SAP. I would not put this client secret on a device that is deployed to the field as it allows uncontrolled access to your tenant by anybody.
Other options:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi fbraun92 ,
to get the OAuth token you need to call the UAA from the SAP CP Cloud Foundry Environment by executing the follwing HTTP Post call:
https://{{tenant_id}}.authentication.eu10.hana.ondemand.com/oauth/token
hopefully this is what u need.
br,
fabian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi f.lehmann ,
thank you for your help. The link you provided doesn't work for my environment. However, based on the similarity of your link, I figured out that this link is sent out via email by the SAP IoT Application Enablement onboarding team when you purchase your instance. In that email the URL was called Audience. Since I was not the one ordering the instance, I was not aware of this email. The email also contains the client_id (Client key) and the client_secret (Token service password) you then need to add to your message body.
Best regards,
Frederik
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.